public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/108690] New: -Wstrict-prototypes too picky for C23
@ 2023-02-07  2:50 eggert at gnu dot org
  2023-02-07  2:54 ` [Bug c/108690] " pinskia at gcc dot gnu.org
  2023-02-07 19:09 ` sam at gentoo dot org
  0 siblings, 2 replies; 3+ messages in thread
From: eggert at gnu dot org @ 2023-02-07  2:50 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108690
           Summary: -Wstrict-prototypes too picky for C23
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: eggert at gnu dot org
  Target Milestone: ---

We ran into this problem in Gnulib when considering how to migrate towards C23.

With GCC 12.2.1 20221121 (Red Hat 12.2.1-4) on x86-64, compile the following
one-line program t.c with 'gcc -S -std=gnu2x -Wstrict-prototypes t.c':

int f ();

GCC complains:

t.c:1:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
    1 | int f ();
      | ^~~

This diagnostic is incorrect, because in C23 every function declaration and
definition is prototyped: 'int f ();' means the same thing as 'int f (void);'.
This incorrect warning is causing us to think we should stop using
-Wstrict-prototypes, but that would have a negative consequence in the common
case of pre-C23 builds.

In short, -Wstrict-prototypes should be a no-op in C23, since all functions are
prototyped in C23.

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

* [Bug c/108690] -Wstrict-prototypes too picky for C23
  2023-02-07  2:50 [Bug c/108690] New: -Wstrict-prototypes too picky for C23 eggert at gnu dot org
@ 2023-02-07  2:54 ` pinskia at gcc dot gnu.org
  2023-02-07 19:09 ` sam at gentoo dot org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-02-07  2:54 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED
   Target Milestone|---                         |13.0

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed on the trunk by r13-2349-g0a4b219d39c74ae

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

* [Bug c/108690] -Wstrict-prototypes too picky for C23
  2023-02-07  2:50 [Bug c/108690] New: -Wstrict-prototypes too picky for C23 eggert at gnu dot org
  2023-02-07  2:54 ` [Bug c/108690] " pinskia at gcc dot gnu.org
@ 2023-02-07 19:09 ` sam at gentoo dot org
  1 sibling, 0 replies; 3+ messages in thread
From: sam at gentoo dot org @ 2023-02-07 19:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Sam James <sam at gentoo dot org> ---
Please add https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108694 to See Also.

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

end of thread, other threads:[~2023-02-07 19:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-07  2:50 [Bug c/108690] New: -Wstrict-prototypes too picky for C23 eggert at gnu dot org
2023-02-07  2:54 ` [Bug c/108690] " pinskia at gcc dot gnu.org
2023-02-07 19:09 ` sam at gentoo dot 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).