Summary: | Define -Wextra strictly in terms of other warning flags | ||
---|---|---|---|
Product: | gcc | Reporter: | ac131313 |
Component: | middle-end | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | NEW --- | ||
Severity: | enhancement | CC: | davidfromonline, egallager, gcc-bugs, gnu, manu, mpolacek, msebor |
Priority: | P3 | Keywords: | diagnostic, easyhack |
Version: | unknown | ||
Target Milestone: | --- | ||
See Also: |
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53313 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108700 |
||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2005-12-24 19:53:21 | |
Bug Depends on: | 63181, 68897, 81453 | ||
Bug Blocks: | 44209 |
Description
ac131313
2002-08-20 07:36:01 UTC
Confirmed with mainline (20030523), this is something nice to have. I forgot to mention that on the mainline -W is now an alias for -Wextra, so it looks like it is partly fixed. (resummarizing due to renaming of -W) Not clear that this is technically fixed; shouldn't -Wextra also be defined strictly in terms of other warning flags? And I don't know if it is yet, but I'd guess not. Subject: Re: Define -Wextra strictly in terms of other warning
flags
> Not clear that this is technically fixed; shouldn't -Wextra also be defined
> strictly in terms of other warning flags? And I don't know if it is yet,
> but I'd guess not.
You're correct, it isn't fixed.
*** Bug 28876 has been marked as a duplicate of this bug. *** Subject: Bug number PR7651 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-12/msg01103.html Subject: Bug 7651 Author: manu Date: Sat Dec 16 16:48:01 2006 New Revision: 119963 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=119963 Log: 2006-12-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR middle-end/7651 * c.opt (Wempty-body): New. * doc/invoke.texi (Wempty-body): Document it. (Wextra): Enabled by -Wextra. * c-opts.c (c_common_post_options): Enabled by -Wextra. * c-common.c (empty_body_warning): Replace Wextra with Wempty-body. * c-parser.c (c_parser_c99_block_statement): Likewise. testsuite/ * gcc.dg/20001116-1.c: Replace -Wextra with -Wempty-body. * gcc.dg/if-empty-1.c: Likewise. * gcc.dg/pr23165.c: Likewise. * g++.dg/warn/empty-body.C: Likewise. Modified: trunk/gcc/ChangeLog trunk/gcc/c-common.c trunk/gcc/c-opts.c trunk/gcc/c-parser.c trunk/gcc/c.opt trunk/gcc/doc/invoke.texi trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/g++.dg/warn/empty-body.C trunk/gcc/testsuite/gcc.dg/20001116-1.c trunk/gcc/testsuite/gcc.dg/if-empty-1.c trunk/gcc/testsuite/gcc.dg/pr23165.c Subject: Bug number PR7651 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-12/msg01244.html Subject: Bug number PR7651 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-12/msg01415.html Subject: Bug 7651 Author: manu Date: Fri Dec 22 15:54:05 2006 New Revision: 120151 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=120151 Log: 2006-12-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR middle-end/7651 * c.opt (Wclobbered): New. * doc/invoke.texi (Wclobbered): Document it. (Wextra): Enabled by -Wextra. * c-opts.c (c_common_post_options): Enabled by -Wextra. * flow.c (rest_of_handle_life): Replace Wextra with Wclobbered. * function.c (setjmp_vars_warning): Only warn for Wclobbered. (setjmp_args_warning): Likewise. testsuite/ * gcc.dg/attr-returns_twice-1.c: Replace Wextra with Wclobbered. * gcc.dg/setjmp-1.c: Add explicit Wclobbered. Modified: trunk/gcc/ChangeLog trunk/gcc/c-opts.c trunk/gcc/c.opt trunk/gcc/doc/invoke.texi trunk/gcc/flow.c trunk/gcc/function.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gcc.dg/attr-returns_twice-1.c trunk/gcc/testsuite/gcc.dg/setjmp-1.c Subject: Bug 7651 Author: manu Date: Sat Dec 23 17:45:33 2006 New Revision: 120173 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=120173 Log: 2006-12-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR middle-end/7651 * c.opt (Wmissing-parameter-type): New. * doc/invoke.texi (Wmissing-parameter-type): Document it. (Wextra): Enabled by -Wextra. * c-opts.c (c_common_post_options): Enabled by -Wextra. * c-decl.c (store_parm_decls_oldstyle): Replace Wextra with Wmissing-parameter-type. testsuite/ * gcc.dg/Wmissing-parameter-type.c: New. * gcc.dg/Wmissing-parameter-type-Wextra.c: New. * gcc.dg/Wmissing-parameter-type-no.c: New. Added: trunk/gcc/testsuite/gcc.dg/Wmissing-parameter-type-Wextra.c trunk/gcc/testsuite/gcc.dg/Wmissing-parameter-type-no.c trunk/gcc/testsuite/gcc.dg/Wmissing-parameter-type.c Modified: trunk/gcc/ChangeLog trunk/gcc/c-decl.c trunk/gcc/c-opts.c trunk/gcc/c.opt trunk/gcc/doc/invoke.texi trunk/gcc/testsuite/ChangeLog Subject: Bug number PR7651 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-12/msg01661.html Subject: Bug number PR7651 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-12/msg01663.html Subject: Bug number PR7651 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-12/msg01837.html Subject: Bug number PR7651 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-12/msg01842.html Subject: Bug 7651 Author: manu Date: Tue Jan 2 17:33:25 2007 New Revision: 120347 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=120347 Log: 2007-01-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR middle-end/7651 * c.opt (Wold-style-declaration): New. * doc/invoke.texi (C-only Warning Options): New. (Wold-style-declaration): Document it. (Wextra): Enabled by -Wextra. * c-opts.c (c_common_post_options): Enabled by -Wextra. * c-decl.c (declspecs_add_scspec): Replace -Wextra with -Wold-style-declaration. testsuite/ * gcc.dg/declspec-3.c: Replace -W with -Wold-style-declaration. * gcc.dg/declspec-3-Wextra.c: New. * gcc.dg/declspec-3-no.c: New Added: trunk/gcc/testsuite/gcc.dg/declspec-3-Wextra.c trunk/gcc/testsuite/gcc.dg/declspec-3-no.c Modified: trunk/gcc/ChangeLog trunk/gcc/c-decl.c trunk/gcc/c-opts.c trunk/gcc/c.opt trunk/gcc/doc/invoke.texi trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gcc.dg/declspec-3.c Subject: Bug number PR7651 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-01/msg00440.html Subject: Bug number PR7651 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-01/msg00503.html Subject: Bug number PR7651 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-01/msg00520.html Subject: Bug number PR7651 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-01/msg00608.html Subject: Bug number PR7651 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-01/msg01120.html Subject: Bug number PR7651 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-01/msg01933.html Subject: Bug 7651 Author: manu Date: Mon Feb 12 09:32:08 2007 New Revision: 121843 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=121843 Log: 2007-02-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR middle-end/7651 * doc/invoke.texi (Wunused-value): Update description. (Wextra): Delete item. * opts.c (set_Wextra): Don't use the value of Wextra to set the value of Wunused-value. * c-typeck.c (c_process_expr_stmt): Don't check extra_warnings. (c_finish_stmt_expr): Don't check extra_warnings. (emit_side_effect_warnings): The caller is responsible to check warn_unused_value. cp/ * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings. Check warn_unused_value just once. Modified: trunk/gcc/ChangeLog trunk/gcc/c-typeck.c trunk/gcc/cp/ChangeLog trunk/gcc/cp/cp-gimplify.c trunk/gcc/doc/invoke.texi trunk/gcc/opts.c Subject: Bug number PR7651 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-02/msg01102.html Subject: Bug 7651 Author: manu Date: Sun May 20 00:45:58 2007 New Revision: 124866 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=124866 Log: 2006-05-20 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR middle-end/7651 * doc/invoke.texi (Wreturn-type): Complete description. (Wextra): Delete item about return-type warning. * c-decl.c: Delete redundant Wextra warning. testsuite/ * gcc.dg/20030906-1.c: Replace Wextra with Wreturn-type. * gcc.dg/20030906-2.c: Likewise. * objc.dg/method-17.m: Add -Wreturn-type. * obj-c++.dg/method-21.mm: Likewise. Modified: trunk/gcc/ChangeLog trunk/gcc/c-decl.c trunk/gcc/doc/invoke.texi trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gcc.dg/20030906-1.c trunk/gcc/testsuite/gcc.dg/20030906-2.c trunk/gcc/testsuite/obj-c++.dg/method-21.mm trunk/gcc/testsuite/objc.dg/method-17.m Subject: Bug 7651 Author: manu Date: Sun May 20 20:29:55 2007 New Revision: 124875 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=124875 Log: 2007-05-20 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR middle-end/7651 PR c++/11856 PR c/12963 PR c/23587 PR other/29694 * c.opt (Wtype-limits): New. * doc/invoke.texi (Wtype-limits): Document it. (Wextra): Enabled by -Wextra. * c-opts.c (c_common_post_options): Enabled by -Wextra. * c-common.c (shorten_compare): Warn with Wtype-limits. testsuite/ * gcc.dg/compare6.c: Replace Wall with Wtype-limits. * gcc.dg/Wtype-limits.c: New. * gcc.dg/Wtype-limits-Wextra.c: New. * gcc.dg/Wtype-limits-no.c: New. * g++.dg/warn/Wtype-limits.C: New. * g++.dg/warn/Wtype-limits-Wextra.C: New. * g++.dg/warn/Wtype-limits-no.C: New. Added: trunk/gcc/testsuite/g++.dg/warn/Wtype-limits-Wextra.C trunk/gcc/testsuite/g++.dg/warn/Wtype-limits-no.C trunk/gcc/testsuite/g++.dg/warn/Wtype-limits.C trunk/gcc/testsuite/gcc.dg/Wtype-limits-Wextra.c trunk/gcc/testsuite/gcc.dg/Wtype-limits-no.c trunk/gcc/testsuite/gcc.dg/Wtype-limits.c Modified: trunk/gcc/ChangeLog trunk/gcc/c-common.c trunk/gcc/c-opts.c trunk/gcc/c.opt trunk/gcc/doc/invoke.texi trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gcc.dg/compare6.c Subject: Bug 7651 Author: manu Date: Fri Aug 8 23:32:23 2008 New Revision: 138892 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=138892 Log: 2008-08-09 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR 7651 * doc/invoke.texi (-Wextra): Move warning from here... (-Wuninitialized): ... to here. cp/ * class.c (check_bases_and_members): Warn with -Wuninitialized instead of -Wextra. testsuite/ * g++.dg/warn/Wuninitializable-member.C: New. * g++.dg/warn/Wuninitializable-member-no.C: New. Added: trunk/gcc/testsuite/g++.dg/warn/Wuninitializable-member-no.C trunk/gcc/testsuite/g++.dg/warn/Wuninitializable-member.C Modified: trunk/gcc/ChangeLog trunk/gcc/cp/ChangeLog trunk/gcc/cp/class.c trunk/gcc/doc/invoke.texi trunk/gcc/testsuite/ChangeLog A good way to finish this is to find which option in Clang warns for the corresponding thing in Wextra and add the same option to GCC. I can take care of writing and testing the patches but someone else would need to do the search for each warning. I'll look at it if I find some free time, this should be easy. (In reply to Marek Polacek from comment #29) > I'll look at it if I find some free time, this should be easy. Fine, although this is such a minor issue that it doesn't seem worth your time/skills. I'd rather see you tackle the really challenging stuff that newbies and sporadic contributors could not manage, like the folding in the FEs or PR52959 or the various bugs present in our macro unwinder (see point I at https://gcc.gnu.org/wiki/Better_Diagnostics). The last ones would require some discussion with Dodji about what result he really wants to see. Perhaps this would be easier for you than for an outsider. GCC 5.1 has been released. GCC 5.2 is being released, adjusting target milestone to 5.3. non-regressions should not have target milestones. This should be easy (apart from the option name bike-shedding) cc-ing Martin Sebor since this bug is relevant to this blog post he wrote: https://developers.redhat.com/blog/2019/03/13/understanding-gcc-warnings/ (In reply to Manuel López-Ibáñez from comment #16) > Subject: Bug 7651 > > Author: manu > Date: Tue Jan 2 17:33:25 2007 > New Revision: 120347 > > URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=120347 > Log: > 2007-01-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org> > > PR middle-end/7651 > * c.opt (Wold-style-declaration): New. > * doc/invoke.texi (C-only Warning Options): New. > (Wold-style-declaration): Document it. > (Wextra): Enabled by -Wextra. > * c-opts.c (c_common_post_options): Enabled by -Wextra. > * c-decl.c (declspecs_add_scspec): Replace -Wextra with > -Wold-style-declaration. > > testsuite/ > * gcc.dg/declspec-3.c: Replace -W with -Wold-style-declaration. > * gcc.dg/declspec-3-Wextra.c: New. > * gcc.dg/declspec-3-no.c: New > > Added: > trunk/gcc/testsuite/gcc.dg/declspec-3-Wextra.c > trunk/gcc/testsuite/gcc.dg/declspec-3-no.c > Modified: > trunk/gcc/ChangeLog > trunk/gcc/c-decl.c > trunk/gcc/c-opts.c > trunk/gcc/c.opt > trunk/gcc/doc/invoke.texi > trunk/gcc/testsuite/ChangeLog > trunk/gcc/testsuite/gcc.dg/declspec-3.c Would have been nice to have a testcase explicitly named gcc.dg/Wold-style-declaration.c, too, for easier findability |