This is the mail archive of the gcc@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: Projects for beginners


Kaveh R. Ghazi wrote:-

> But in the mean time, as I toyed with implementing it myself, I
> realized that the current "poison" behaves exactly as I wanted for the
> new feature.  Apparently Zack's description about it triggering on
> macros was wrong.

[...]

> foo.c:15:3: attempt to use poisoned "bcopy"
> foo.c:16:3: attempt to use poisoned "malloc"
> foo.c:18:16: attempt to use poisoned "bcopy"
> 
> I.e. no warnings for calling strdup or memcpy whose definition contain
> the poisoned tokens!
> 
> Now is this a bug or a feature? :-)

Well, it's a feature now at least :-)  I suspect this is a consequence of
moving to a token-based preprocessor, rather than one that continually
rescans text when expanding macros.

The lexer handles the warnings, so anything not coming out of the original
source file, in particular anything from the macro expander, doesn't get
warned about.  Let's consider this a happy consequence :-)

Neil.


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