2011/1/24 Ian Lance Taylor <i...@google.com>: > Daniel Marjamäki <daniel.marjam...@gmail.com> writes: > >> 2011/1/24 Ian Lance Taylor <i...@google.com>: >> >>> The problem with warnings for this kind of code in C/C++ is that it >>> often arises in macro expansions. >> >> I see... so it won't be included in gcc. :-( > > Actually, I think it could be included in gcc, provided you (or > somebody) first implements a way to not warn in a macro expansion. > > Ian >
I first thought it sounded too difficult. Even though conceptually in my mind it seems to be a pretty simple task. I assume the preprocessor emits tokens in some structure format. When a token is emitted it should be pretty simple to check if a macro is expanded, shouldn't it? So I just add some flag to this token structure. And then I need to preserve that information at least until "constant folding" occurs. I haven't even located the "constant folding" yet. I will try to investigate this. Regards, Daniel