Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #107880

Re: Need help fixing a "previously defined" error

Newsgroups comp.lang.c
Subject Re: Need help fixing a "previously defined" error
From Peabody <waybackNO584SPAM44@yahoo.com>
Date 2017-04-08 13:04 -0500
Message-ID <20170408-180409.292.0@Peabody.ssl.astraweb.com> (permalink)
References <20170408-130720.9.0@Peabody.ssl.astraweb.com> <t31iec5ro3htegq46dbo6s5fh93q0jvht9@4ax.com>
Organization Unlimited download news at news.astraweb.com

Show all headers | View raw


Barry Schwarz says...

 > The above conditional compilation is LCC's way of
 > acknowledging that everything in that block is an
 > extension to the language as defined by the standard.
 > If you need any of those extensions, then you do not
 > define the macro __ANSI__ONLY__.  If you don't want the
 > LCC extensions, then you do define that macro.

 > Since your project was not originally created with LCC,
 > it seems very likely that you do not need any of LCC's
 > extensions.  In that case, it would make sense to define
 > the macro.

 > This completely ignores the question of whether the
 > original code required any Microsoft-unique compiler
 > features.  This includes extensions and compiler
 > eccentricities.  For example, the code may depend on
 > long and int being the same size or size_t being an
 > unsigned int.

Doesn't it also raise the question of whether just defining
the macro might cause the program to behave differently even
if it successfully compiles?  In other words, if TI had
included the macro originally, would the code still work the
way it does?  I guess I don't understand whether ANSIC__ONLY
just limits the functions that can be called, or whether it
changes behavior (like long vs int as you described).

Anyway, the idea is that by defining the macro, I can
otherwise leave TI's code the way it is, and leave LCC's
string.h the way it is, but eliminate the error.

 > Even if the code uses only standard features, there are
 > additional potential issues due to the evolution of the
 > standard over the years. For example, it used to be
 > permitted to omit the return type in a function
 > declaration and the compiler was required to assume the
 > type was int.  This is now a constraint violation.

 > The bottom line is merely getting a clean compile should
 > be only the first step before attempting any
 > modifications.  You also need to verify that the newly
 > compiled program behaves reasonably similar to the
 > original program.

The program does lots of different things, and I don't
really have a way to test all of them because I don't have
the chips they apply to.  Actually, I don't even understand
all of them.  So you're saying that I would have to find the
same version of Visual C that was used originally, which I
don't think I know unless it's in the exe somewhere, to be
sure that it behaves the same.

 > As Spiros suggested, defining the macro in every source
 > and TI header file that includes string.h, directly or
 > indirectly, is the safest approach.

Ok.

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Need help fixing a "previously defined" error Peabody <waybackNO584SPAM44@yahoo.com> - 2017-04-08 08:07 -0500
  Re: Need help fixing a "previously defined" error James Kuyper <jameskuyper@verizon.net> - 2017-04-08 10:47 -0400
    Re: Need help fixing a "previously defined" error Peabody <waybackNO584SPAM44@yahoo.com> - 2017-04-08 12:51 -0500
      Re: Need help fixing a "previously defined" error Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-04-08 20:03 +0100
      Re: Need help fixing a "previously defined" error Spiros Bousbouras <spibou@gmail.com> - 2017-04-08 19:06 +0000
      Re: Need help fixing a "previously defined" error James Kuyper <jameskuyper@verizon.net> - 2017-04-08 15:17 -0400
  Re: Need help fixing a "previously defined" error Spiros Bousbouras <spibou@gmail.com> - 2017-04-08 15:29 +0000
  Re: Need help fixing a "previously defined" error Barry Schwarz <schwarzb@dqel.com> - 2017-04-08 09:21 -0700
    Re: Need help fixing a "previously defined" error Peabody <waybackNO584SPAM44@yahoo.com> - 2017-04-08 13:04 -0500
      Re: Need help fixing a "previously defined" error James Kuyper <jameskuyper@verizon.net> - 2017-04-08 15:33 -0400
        Re: Need help fixing a "previously defined" error Spiros Bousbouras <spibou@gmail.com> - 2017-04-08 19:51 +0000
        Re: Need help fixing a "previously defined" error Peabody <waybackNO584SPAM44@yahoo.com> - 2017-04-08 16:24 -0500
    Re: Need help fixing a "previously defined" error Keith Thompson <kst-u@mib.org> - 2017-04-08 18:45 -0700
  Re: Need help fixing a "previously defined" error bartc <bc@freeuk.com> - 2017-04-08 17:46 +0100
    Re: Need help fixing a "previously defined" error Peabody <waybackNO584SPAM44@yahoo.com> - 2017-04-08 13:19 -0500
  Re: Need help fixing a "previously defined" error David Brown <david.brown@hesbynett.no> - 2017-04-09 12:38 +0200
    Re: Need help fixing a "previously defined" error Peabody <waybackNO584SPAM44@yahoo.com> - 2017-04-09 07:52 -0500
      Re: Need help fixing a "previously defined" error David Brown <david.brown@hesbynett.no> - 2017-04-09 17:02 +0200
        Re: Need help fixing a "previously defined" error Peabody <waybackNO584SPAM44@yahoo.com> - 2017-04-09 18:20 -0500
          Re: Need help fixing a "previously defined" error James Kuyper <jameskuyper@verizon.net> - 2017-04-09 22:06 -0400
          Re: Need help fixing a "previously defined" error David Brown <david.brown@hesbynett.no> - 2017-04-10 09:07 +0200
            Re: Need help fixing a "previously defined" error Peabody <waybackNO584SPAM44@yahoo.com> - 2017-04-10 09:11 -0500
              Re: Need help fixing a "previously defined" error David Brown <david.brown@hesbynett.no> - 2017-04-10 17:31 +0200
                Re: Need help fixing a "previously defined" error Peabody <waybackNO584SPAM44@yahoo.com> - 2017-04-10 12:48 -0500

csiph-web