public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/113825] New: missing warning for omitted parameter names in function definitions (c23 extension)
@ 2024-02-08 11:14 jemarch at gcc dot gnu.org
  2024-02-08 16:41 ` [Bug c/113825] " jsm28 at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: jemarch at gcc dot gnu.org @ 2024-02-08 11:14 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113825
           Summary: missing warning for omitted parameter names in
                    function definitions (c23 extension)
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jemarch at gcc dot gnu.org
  Target Milestone: ---

Given this code:

  struct bpf_iter_num;
  static inline int bpf_iter_num_next(struct bpf_iter_num *) { return 1; }

Clang gives us this warning:

 clang -target x86_64  -c foo.c
 foo.c:2:58: warning: omitting the parameter name in a function definition is a
C23 extension [-Wc23-extensions]
    2 | static inline int bpf_iter_num_next(struct bpf_iter_num *) { return 1;
}
      |                                                          ^
 1 warning generated.

However, GCC doesn't emit any warning even when it is explicitly invoked with
-std=gnu89 or -std=c99.

Shall we emit warnings for this and other C23 extensions when not building with
std=c23?

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

* [Bug c/113825] missing warning for omitted parameter names in function definitions (c23 extension)
  2024-02-08 11:14 [Bug c/113825] New: missing warning for omitted parameter names in function definitions (c23 extension) jemarch at gcc dot gnu.org
@ 2024-02-08 16:41 ` jsm28 at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2024-02-08 16:41 UTC (permalink / raw)
  To: gcc-bugs

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

Joseph S. Myers <jsm28 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Joseph S. Myers <jsm28 at gcc dot gnu.org> ---
This is diagnosed as expected with -pedantic (given a standard older than C23)
or -Wc11-c23-compat (even in C23 mode); I see no reason for this to be
different from any other extension that doesn't affect the semantics of code
valid in an older standard version.

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

end of thread, other threads:[~2024-02-08 16:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-08 11:14 [Bug c/113825] New: missing warning for omitted parameter names in function definitions (c23 extension) jemarch at gcc dot gnu.org
2024-02-08 16:41 ` [Bug c/113825] " jsm28 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).