public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/95280] New: poor warning for attribute used on a function argument
@ 2020-05-22 19:47 msebor at gcc dot gnu.org
  2020-05-22 21:56 ` [Bug c/95280] " egallager at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: msebor at gcc dot gnu.org @ 2020-05-22 19:47 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95280
           Summary: poor warning for attribute used on a function argument
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

GCC warns when attribute used is specified on a function argument (e.g., as a
mistake instead of unused) but the warning is devoid of any useful information:

$ cat z.c && gcc -S -Wall -Wextra z.c
int f (int __attribute__ ((used)) i);
z.c:1:1: warning: ‘used’ attribute ignored [-Wattributes]
    1 | int f (int __attribute__ ((used)) i);
      | ^~~


In contrast, Clang issues a much more informative message:

z.c:1:28: warning: 'used' attribute only applies to variables with non-local
      storage, functions, and Objective-C methods [-Wignored-attributes]
int f (int __attribute__ ((used)) i);
                           ^
1 warning generated.

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

* [Bug c/95280] poor warning for attribute used on a function argument
  2020-05-22 19:47 [Bug c/95280] New: poor warning for attribute used on a function argument msebor at gcc dot gnu.org
@ 2020-05-22 21:56 ` egallager at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: egallager at gcc dot gnu.org @ 2020-05-22 21:56 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Gallager <egallager at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=37874
                 CC|                            |egallager at gcc dot gnu.org

--- Comment #1 from Eric Gallager <egallager at gcc dot gnu.org> ---
While touching the code affecting attributes on function arguments, it might
also be worth taking a look at bug 37874

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

end of thread, other threads:[~2020-05-22 21:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-22 19:47 [Bug c/95280] New: poor warning for attribute used on a function argument msebor at gcc dot gnu.org
2020-05-22 21:56 ` [Bug c/95280] " egallager 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).