This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Preprocessor and -C / -CC


On Wed, May 10, 2000 at 04:27:10PM -0700, Zack Weinberg wrote:

 > I've been trying to decide if this is the right behavior or not,
 > myself.  I definitely think comments inside the macro body should
 > appear only where the macro is expanded, but I'm not sure about
 > something like
 > 
 > #define foo(a, b)  bar(a, b, 12)  /* default argument form of bar */
 > 
 > the comment might be more useful if it appeared where the #define was,
 > and _not_ where foo() is expanded.  Jason, what would lint want?

Well, in the cccp version of CPP, the comments appeared where the
macro was defined with -C, and with the NetBSD-added -CC option,
it appeared both where the macro was defined, and where the macro
was expanded.

Lint doesn't particular care about it appearing where it is defined,
but it is absolutely required for it to appear where it is expanded,
hence -CC (we didn't feel changing the behavior of -C was necessarily
a good thing as some people might have expected that behavior).

-- 
        -- Jason R. Thorpe <thorpej@zembu.com>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]