This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Projects for beginners
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Subject: Re: Projects for beginners
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Date: Thu, 8 Mar 2001 19:50:17 +0000
- Cc: gcc at gcc dot gnu dot org, jsm28 at cam dot ac dot uk, zackw at Stanford dot EDU
- References: <200103081943.OAA18596@caip.rutgers.edu>
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.