tech-toolchain archive

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

Re: -U__GNUC__ during lint pass



On Fri, Aug 29, 2008 at 10:48:31AM +1000, Gregory McGarry wrote:
> I noticed that lint undefines __GNUC__ during it's pass.  The source tree 
> actually requires this to be done.  I added a similar undefinition of 
> __PCC__.
>
> But it seems that this may be a hack to avoid auditing the source tree and 
> sprinkling some __lint__ tests in the headers.

I don't see why. Lint is not gcc, nor is it pcc, and there's no reason
to expect it to understand gcc-specific (or pcc-specific) material.
Nor is there anything to be gained by adding "&& !defined(__lint__)"
to every use of #ifdef __GNUC__ anywhere in the tree.

The reason lint undefines __GNUC__ is that it uses gcc's preprocessor,
so the symbol would appear by default if it weren't suppressed.
Presumably if pcc is in use it uses pcc's preprocessor and the same
reasoning holds.

-- 
David A. Holland
dholland%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index