[c-family/49654/49655] reject invalid options in pragma diagnostic
commitc1822f9c9b169c9588a110522dd60d579edaf6d1
authorManuel López-Ibáñez <manu@gcc.gnu.org>
Wed, 23 Sep 2015 13:07:07 +0000 (23 13:07 +0000)
committerManuel López-Ibáñez <manu@gcc.gnu.org>
Wed, 23 Sep 2015 13:07:07 +0000 (23 13:07 +0000)
tree36263b59f5fe1b8892bd6bafafc963cd33e5923f
parent9ea4e88f177aec6d897055efc954b4de05766017
[c-family/49654/49655] reject invalid options in pragma diagnostic

Use find_opt instead of linear search through options in
handle_pragma_diagnostic (PR 49654) and reject non-warning options and
options not valid for the current language (PR 49655).

gcc/testsuite/ChangeLog:

2015-09-23  Manuel López-Ibáñez  <manu@gcc.gnu.org>

PR c/49655
* gcc.dg/pragma-diag-6.c: New test.

gcc/ChangeLog:

2015-09-23  Manuel López-Ibáñez  <manu@gcc.gnu.org>

PR c/49655
* opts.h (write_langs): Declare.
* opts-global.c (write_langs): Make it extern.

gcc/c-family/ChangeLog:

2015-09-23  Manuel López-Ibáñez  <manu@gcc.gnu.org>

PR c/49654
PR c/49655
* c-pragma.c (handle_pragma_diagnostic): Detect non-warning
options and options not valid for the current language.

From-SVN: r228049
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c-pragma.c
gcc/opts-global.c
gcc/opts.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pragma-diag-6.c [new file with mode: 0644]