Source-Changes archive

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

Re: CVS commit: syssrc/sys/arch/pmax/pmax



In article <3C08E0F9.96A78CC2%augustsson.net@localhost> Lennart wrote:
: Robert Elz wrote:

:> No it isn't
:>
:>         #undef thing
:>
:>         #if thing > 1
:>
:> has always been interpreted as "#if 0 > 1"

: Yes, it has always worked in Unix based cpp.  It is still abuse. :-)
: (It hasn't always worked in other cpps.)

  ANSI C and C99 say it isn't abuse:

ANSI: 3.8.1 Conditional Inclusion
C99: 6.10.1 Conditional Inclusion

        [...]

       [#3] Prior to evaluation, macro invocations in the  list  of
       preprocessing   tokens  that  will  become  the  controlling
       constant expression are replaced  (except  for  those  macro
       names  modified  by  the defined unary operator), just as in
       normal text.  [...] After all
       replacements due to macro expansion and  the  defined  unary
       operator  have been performed, all remaining identifiers are
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       replaced with the pp-number 0, and then  each  preprocessing
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       token  is  converted  into  a  token.  [...]

                                                yours,
                                                dillo



Home | Main Index | Thread Index | Old Index