Barry Gershenfeld wrote:
>>Ugh. -i is of course the wrong flag, as pointed out in another post.
>
>
> I take it you meant to say -E . I don't know gcc well enough to know that
> you weren't thinking of something else.
Yeah, that's what I meant. You can also invoke cpp directly, but I
typically use -E to make sure the setup is consistent.
> All I could get was either the source spit back out with the directives gone
> or just the directives but no values shown. I guess I could "plant"
> something to see what got included but I specified no tricks...
>
> Because the trick I used was simple enough. I put this in:
>
> message YES_YOU_GOT_HERE
>
> And it produces the message "parse error before YES_YOU_GOT_HERE" when
> compiled, which is a good enough trace. It was good enough for me to find
> out that the directives were set the way I thought, and to move on ("these
> aren't the bugs you're looking for").
Hmm... I don't know that that would do what you'd want, as the parse
error would happen *after* the preprocessor completes it's pass.
> Still it's hard to believe no one in the history of gcc ever thought you'd
> want to plant an advisory message in your source.
Acually, you can use #error to accomplish this, and #warning to let the
compiler continue once it got there.
cpp also has a "-d" flag that lets you specify additional debugging
information to be added to it's output. For example, you can do things
like "-dM" so that it shows where a macro has been defined.
--Chris
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg