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]
Other format: [Raw text]

Re: Separate preprocess and compile: hack or feature?


Hi Jakub,

Jakub Jelinek <jakub@redhat.com> writes:

> Especially in recent GCC versions the amount of differences for warnings and
> errors keeps dramatically increasing, with separate preprocessing simply
> too much information is lost (macro contexts, lint style comments, exact
> locations, system header issues, ...).
> 
> So it is far better to not use -E, but instead -E -fdirectives-only
> for the preprocessing step, which will get you also single file with all the
> includes in it, but macros, comments etc. are still in there.

Uh, thanks, that's very helpful.

One use case for removing comments is detecting and ignoring comments-only
changes (via a checksum). But that's relatively minor. We could probably
re-process the result ourselves and strip the comments for that (will have
to recognize comments for the C++ module import detection anyway).

Also, preserving comments helps with some VC issues (e.g., a/**/b).


> Tried to explain that to the ccache people, but they aren't listening.

I am, on the hand, all ears ;-).

Thanks,
Boris


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