public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/82922] Request: add -Wstrict-prototypes to -Wextra as K&R style is obsolescent
       [not found] <bug-82922-4@http.gcc.gnu.org/bugzilla/>
@ 2022-11-08 19:37 ` david at westcontrol dot com
  2022-11-08 19:40 ` sam at gentoo dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: david at westcontrol dot com @ 2022-11-08 19:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82922

--- Comment #9 from David Brown <david at westcontrol dot com> ---
Could -Wstrict-prototypes be added to -Wall, or even considered enabling by
default?  The next C standard will make "void foo()" mean the same as "void
foo(void)", like in C++, which makes the scope for confusion high.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/82922] Request: add -Wstrict-prototypes to -Wextra as K&R style is obsolescent
       [not found] <bug-82922-4@http.gcc.gnu.org/bugzilla/>
  2022-11-08 19:37 ` [Bug c/82922] Request: add -Wstrict-prototypes to -Wextra as K&R style is obsolescent david at westcontrol dot com
@ 2022-11-08 19:40 ` sam at gentoo dot org
  2022-11-08 19:44 ` fw at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: sam at gentoo dot org @ 2022-11-08 19:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82922

--- Comment #10 from Sam James <sam at gentoo dot org> ---
(In reply to David Brown from comment #9)
> Could -Wstrict-prototypes be added to -Wall, or even considered enabling by
> default?  The next C standard will make "void foo()" mean the same as "void
> foo(void)", like in C++, which makes the scope for confusion high.

Yes please, given Clang has done this (or essentially this, and added its own
-Wdeprecated-non-prototype):
- https://lwn.net/Articles/913505/
-
https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213
-
https://archives.gentoo.org/gentoo-dev/message/dd9f2d3082b8b6f8dfbccb0639e6e240

Anything which makes it easier to spot things which are going to become fatal
in future is a good idea. Otherwise we'll have a headache now with Clang and a
headache in a few years when defaults shift to c23.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/82922] Request: add -Wstrict-prototypes to -Wextra as K&R style is obsolescent
       [not found] <bug-82922-4@http.gcc.gnu.org/bugzilla/>
  2022-11-08 19:37 ` [Bug c/82922] Request: add -Wstrict-prototypes to -Wextra as K&R style is obsolescent david at westcontrol dot com
  2022-11-08 19:40 ` sam at gentoo dot org
@ 2022-11-08 19:44 ` fw at gcc dot gnu.org
  2022-11-08 19:46 ` sam at gentoo dot org
  2022-11-08 19:49 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: fw at gcc dot gnu.org @ 2022-11-08 19:44 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82922

--- Comment #11 from Florian Weimer <fw at gcc dot gnu.org> ---
(In reply to David Brown from comment #9)
> Could -Wstrict-prototypes be added to -Wall, or even considered enabling by
> default?  The next C standard will make "void foo()" mean the same as "void
> foo(void)", like in C++, which makes the scope for confusion high.

I think the churn from changing void foo() to void foo(void) to avoid the
warning is too high, and unnecessary for the upcoming C language change. A more
target warning could make sense, though.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/82922] Request: add -Wstrict-prototypes to -Wextra as K&R style is obsolescent
       [not found] <bug-82922-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2022-11-08 19:44 ` fw at gcc dot gnu.org
@ 2022-11-08 19:46 ` sam at gentoo dot org
  2022-11-08 19:49 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: sam at gentoo dot org @ 2022-11-08 19:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82922

--- Comment #12 from Sam James <sam at gentoo dot org> ---
GCC lacks an equivalent for Clang's -Wdeprecated-non-prototype, right?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/82922] Request: add -Wstrict-prototypes to -Wextra as K&R style is obsolescent
       [not found] <bug-82922-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2022-11-08 19:46 ` sam at gentoo dot org
@ 2022-11-08 19:49 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-11-08 19:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82922

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Florian Weimer from comment #11)
> (In reply to David Brown from comment #9)
> > Could -Wstrict-prototypes be added to -Wall, or even considered enabling by
> > default?  The next C standard will make "void foo()" mean the same as "void
> > foo(void)", like in C++, which makes the scope for confusion high.
> 
> I think the churn from changing void foo() to void foo(void) to avoid the
> warning is too high, and unnecessary for the upcoming C language change. A
> more target warning could make sense, though.

And even with a more targetted warning we need to be careful about configure
scripts with unprototyped functions.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-11-08 19:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-82922-4@http.gcc.gnu.org/bugzilla/>
2022-11-08 19:37 ` [Bug c/82922] Request: add -Wstrict-prototypes to -Wextra as K&R style is obsolescent david at westcontrol dot com
2022-11-08 19:40 ` sam at gentoo dot org
2022-11-08 19:44 ` fw at gcc dot gnu.org
2022-11-08 19:46 ` sam at gentoo dot org
2022-11-08 19:49 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).