On 3/5/19 3:21 PM, David Malcolm wrote: > On Tue, 2019-03-05 at 15:14 +0100, Martin Liška wrote: >> Hi. >> >> The patch extends option suggestion for both -Werror and >> corresponding >> pragram. >> >> Patch can bootstrap on x86_64-linux-gnu and survives regression >> tests. >> >> Ready to be installed after stage1 opens? >> Thanks, >> Martin > > Good idea - thanks. > > The patch also fixes some quoting issues.
Yep. Btw. I have a huge patch that fixes very many quoting issues. I'll send as stage1 material once I'll build all targets. > > Ideally we'd also provide fix-it hints for the unknown options - but > I'm guessing we probably don't have accurate enough location_t values > for that - are the location_t values just for the whole of the line > containing the pragma, or do they have fine-grained token information? It's fine-grained if I see correctly: ./xgcc -B. /home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/pragma-diag-6.c /home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/pragma-diag-6.c:2:30: warning: option ‘-Wnoexcept’ is valid for C++/ObjC++ but not for C [-Wpragmas] 2 | #pragma GCC diagnostic error "-Wnoexcept" /* { dg-warning "is valid for C../ObjC.. but not for C" } */ | ^~~~~~~~~~~~ That said, will you please do a follow up patch? > > That said, the patch is OK for next stage 1 as-is. Thanks, Martin > > Dave > >> gcc/ChangeLog: >> >> 2019-03-05 Martin Liska <mli...@suse.cz> >> >> * opts.c (enable_warning_as_error): Provide hints >> for unknown options. >> >> gcc/c-family/ChangeLog: >> >> 2019-03-05 Martin Liska <mli...@suse.cz> >> >> * c-pragma.c (handle_pragma_diagnostic): Provide hints >> for unknown options. >> >> gcc/testsuite/ChangeLog: >> >> 2019-03-05 Martin Liska <mli...@suse.cz> >> >> * gcc.dg/Werror-13.c: Add new tests for it. >> * gcc.dg/pragma-diag-6.c: Likewise. >> --- >> gcc/c-family/c-pragma.c | 13 +++++++++++-- >> gcc/opts.c | 17 ++++++++++++++--- >> gcc/testsuite/gcc.dg/Werror-13.c | 12 +++++++----- >> gcc/testsuite/gcc.dg/pragma-diag-6.c | 3 +++ >> 4 files changed, 35 insertions(+), 10 deletions(-) >> >>