[Bug c/40989] -Werror= and #pragma diagnostics do not work with group flags

2019-05-21 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40989
Bug 40989 depends on bug 53063, which changed state.

Bug 53063 Summary: encode group options in the .opt files
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53063

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |FIXED

[Bug c/40989] -Werror= and #pragma diagnostics do not work with group flags

2014-08-19 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40989

Manuel López-Ibáñez manu at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #11 from Manuel López-Ibáñez manu at gcc dot gnu.org ---
I consider this FIXED. Almost all options now work. The ones that don't are due
to missing features in the *.opt files, which are tracked in PR53063.

[Bug c/40989] -Werror= and #pragma diagnostics do not work with group flags

2012-10-20 Thread manu at gcc dot gnu.org

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40989

--- Comment #10 from Manuel López-Ibáñez manu at gcc dot gnu.org 2012-10-20 
14:17:14 UTC ---
Author: manu
Date: Sat Oct 20 14:17:08 2012
New Revision: 192635

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=192635
Log:
2012-10-20  Manuel López-Ibáñez  m...@gcc.gnu.org

PR c/53063
PR c/40989
c-family/
* c.opt (Waddress,Wchar-subscripts,Wsign-conversion,Wimplicit,
Wimplicit-function-declaration,Wimplicit-int,Wsizeof-pointer-memaccess,
Wnarrowing,Wparentheses,Wpointer-sign,Wreturn-type,Wsequence-point,
Wsign-compare,Wuninitialized,Wmaybe-uninitialized,Wunused,
Wvolatile-register-var): Add LangEnabledBy or EnabledBy.
* c-opts.c (c_common_handle_option): Remove explicit handling from
here.
(c_common_post_options): Likewise.
gcc/
* opts.c (finish_options): Remove explicit handling from here.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/c-family/ChangeLog
trunk/gcc/c-family/c-opts.c
trunk/gcc/c-family/c.opt
trunk/gcc/opts.c


[Bug c/40989] -Werror= and #pragma diagnostics do not work with group flags

2012-10-16 Thread manu at gcc dot gnu.org

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40989

--- Comment #8 from Manuel López-Ibáñez manu at gcc dot gnu.org 2012-10-16 
15:31:55 UTC ---
Author: manu
Date: Tue Oct 16 15:31:46 2012
New Revision: 192502

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=192502
Log:
2012-10-16  Manuel López-Ibáñez  m...@gcc.gnu.org

PR c/53063
PR c/40989
gcc/
* optc-gen.awk: Handle new form of LangEnabledBy.
* opts.c (set_Wstrict_aliasing): Declare here. Make static.
* common.opt (Wstrict-aliasing=,Wstrict-overflow=): Do not use Init.
* doc/options.texi (LangEnabledBy): Document new form.
* flags.h (set_Wstrict_aliasing): Do not declare.
c-family/
* c.opt (Wstrict-aliasing=,Wstrict-overflow=): Use LangEnabledBy.
* c-opts.c (c_common_handle_option): Do not set them here. Add
comment.
(c_common_post_options): Likewise.
testsuite/
* gcc.dg/Wstrict-overflow-24.c: New.

Added:
trunk/gcc/testsuite/gcc.dg/Wstrict-overflow-24.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/c-family/ChangeLog
trunk/gcc/c-family/c-opts.c
trunk/gcc/c-family/c.opt
trunk/gcc/common.opt
trunk/gcc/doc/options.texi
trunk/gcc/flags.h
trunk/gcc/optc-gen.awk
trunk/gcc/opts.c
trunk/gcc/testsuite/ChangeLog


[Bug c/40989] -Werror= and #pragma diagnostics do not work with group flags

2012-10-16 Thread manu at gcc dot gnu.org

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40989

--- Comment #9 from Manuel López-Ibáñez manu at gcc dot gnu.org 2012-10-16 
15:39:08 UTC ---
Author: manu
Date: Tue Oct 16 15:38:58 2012
New Revision: 192503

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=192503
Log:
2012-10-16  Manuel López-Ibáñez  m...@gcc.gnu.org

PR c/53063
PR c/40989
* doc/options.texi (EnabledBy): Document new form.
* optc-gen.awk: Handle new form of EnabledBy.
* common.opt (Wunused-but-set-parameter): Use EnabledBy.
(Wunused-parameter): Likewise.
* opts.c (finish_options): Do not handle them explicitly.
* opt-functions.awk (search_var_name): New.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/common.opt
trunk/gcc/doc/options.texi
trunk/gcc/opt-functions.awk
trunk/gcc/optc-gen.awk
trunk/gcc/opts.c


[Bug c/40989] -Werror= and #pragma diagnostics do not work with group flags

2012-04-27 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40989

Manuel López-Ibáñez manu at gcc dot gnu.org changed:

   What|Removed |Added

 Depends on||53063

--- Comment #7 from Manuel López-Ibáñez manu at gcc dot gnu.org 2012-04-28 
00:11:12 UTC ---
Doing this option by option is stupid. Groups options should be encoded in .opt
files and the code to handle sub-options be automatically generated. PR50363
needs to be fixed first.


[Bug c/40989] -Werror= and #pragma diagnostics do not work with group flags

2010-05-07 Thread ebotcazou at gcc dot gnu dot org


--- Comment #6 from ebotcazou at gcc dot gnu dot org  2010-05-07 10:26 
---
Subject: Bug 40989

Author: ebotcazou
Date: Fri May  7 10:25:54 2010
New Revision: 159149

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=159149
Log:
PR 40989
* gcc-interface/misc.c (gnat_handle_option): Fix long line.

Modified:
trunk/gcc/ada/ChangeLog
trunk/gcc/ada/gcc-interface/misc.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40989



[Bug c/40989] -Werror= and #pragma diagnostics do not work with group flags

2010-05-06 Thread manu at gcc dot gnu dot org


--- Comment #4 from manu at gcc dot gnu dot org  2010-05-06 10:12 ---
Subject: Bug 40989

Author: manu
Date: Thu May  6 10:12:36 2010
New Revision: 159102

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=159102
Log:
2010-05-06  Manuel López-Ibáñez  m...@gcc.gnu.org

PR 40989
* doc/invoke.texi (Wimplicit): Document as C only.
* opts.c (common_handle_option): Add argument kind.
(handle_option): Rename as read_cmdline_option. Factor out code to...
(handle_option): ... here. New.
(handle_options): Rename as read_cmdline_options.
(decode_options): Update call.
(set_option): Use option index instead of option pointer. Classify
diagnostics correctly.
(enable_warning_as_error): Call handle_option.
* opts.h (set_option): Update declaration.
(handle_option): Declare.
* langhooks.h (struct lang_hooks): Add argument kind to
handle_option.
* c.opt (Wimplicit,Wimplicit-int): Initialize to -1.
* c-opts.c (set_Wimplicit): Delete.
(c_family_lang_mask): New static constant.
(c_common_handle_option): Add argument kind. Use handle_option
instead of set_Wimplicit.
(c_common_post_options): warn_implicit and warn_implicit_int
are disabled by default.
* c-common.c (warn_implicit): Do not define here.
* c-common.h (warn_implicit): Do not declare here.
(c_common_handle_option): Update declaration.
* lto-opts.c (lto_reissue_options): Update call to set_option.
java/
* lang.c (java_handle_option): Add argument kind.
fortran/
* options.c (gfc_handle_option): Add argument kind.
* gfortran.h (gfc_handle_option): Update declaration.
ada/
* gcc-interface/misc.c (gnat_handle_option): Add argument kind.
testsuite/
* gcc.dg/pr40989.c: New.

Added:
trunk/gcc/testsuite/gcc.dg/pr40989.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/ada/ChangeLog
trunk/gcc/ada/gcc-interface/misc.c
trunk/gcc/c-common.c
trunk/gcc/c-common.h
trunk/gcc/c-opts.c
trunk/gcc/c.opt
trunk/gcc/doc/invoke.texi
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/gfortran.h
trunk/gcc/fortran/options.c
trunk/gcc/java/ChangeLog
trunk/gcc/java/lang.c
trunk/gcc/langhooks.h
trunk/gcc/lto-opts.c
trunk/gcc/opts.c
trunk/gcc/opts.h
trunk/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40989



[Bug c/40989] -Werror= and #pragma diagnostics do not work with group flags

2010-05-06 Thread manu at gcc dot gnu dot org


--- Comment #5 from manu at gcc dot gnu dot org  2010-05-06 10:22 ---
OK, this is fixed for -Wimplicit and the infrastructure is there to fix it for
all other group flags (just use the new handle_option to enable sub-flags).
However, I don't have time at the moment to go over all subflags. So anyone,
feel free to submit patches about this. If you need some help or mentoring,
just ask.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40989



[Bug c/40989] -Werror= and #pragma diagnostics do not work with group flags

2010-03-11 Thread manu at gcc dot gnu dot org


--- Comment #3 from manu at gcc dot gnu dot org  2010-03-12 00:15 ---
Created an attachment (id=20091)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20091action=view)
patch

This is my current patch to fix this. However, it has a big problem: Since
there is no namespace for options (all options are visible from everywhere),
functions referenced in options.h must be defined in a file that is linked with
everything, which is very inconvenient. Any ideas how to overcome this?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40989