Patch to pass -pedantic flag to cpplib

Zack Weinberg zack@bitmover.com
Fri Sep 10 09:13:00 GMT 1999


Nick Clifton wrote:
> Hi Guys,
> 
>   I would like submit the following patch for approval.  It fixes main
>   in toplev.c so that if the -pedantic command line switch has been
>   specified it will be passed onto cpplib to enable pedantic warnings
>   there.

Rather than doing it this way, I would suggest that if USE_CPPLIB is
on you feed *all* options through cpp_handle_option.  There are a
bunch more options that overlap with the front end: notably the -W
switches. cpp_handle_option doesn't produce error messages if it
doesn't recognize an option; it just returns.

Do this right, and you can take all the cpplib-specific options out of
documented_lang_options, and the front ends won't have to call
cpp_handle_option[s].  But be careful; you don't want to accidentally
start running all Java or Fortran code through the C preprocessor.

zw


More information about the Gcc-patches mailing list