Re: "gcc" complains about a constant being non constant...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Linda A. Walsh" <gcc@xxxxxxxxx> writes:

> The fact that C++ "fixes" this isn't really a difference in the language, it's just a 'next-generation' of the compile time constant folding.  In "C" you'd
> have to do the same thing using "#define"'s which just looked uglier...

I think it is clearly a difference in the language, in that the
respective language standards spell out how things should be handled.


> Can you think of any backward incompatibility if "C were to rold compile
> time constants the same way C++ did?

The C language standard was carefully written to not require the
compiler to implement target arithmetic.  This is particularly an issue
for floating point operations, but it also arises for, e.g., signed
magnitude machines, which were a consideration at the time the C
standard was first written.

The C standard specifies that the preprocessor is explicitly permitted
to use host arithmetic, but such permission would not be appropriate for
constants which are not handled by the preprocessor.

Ian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux