public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/110947] New: Should -Wmissing-variable-declarations not trigger on register variables?
@ 2023-08-08 15:41 ndesaulniers at google dot com
2023-08-08 15:42 ` [Bug c/110947] " pinskia at gcc dot gnu.org
0 siblings, 1 reply; 2+ messages in thread
From: ndesaulniers at google dot com @ 2023-08-08 15:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110947
Bug ID: 110947
Summary: Should -Wmissing-variable-declarations not trigger on
register variables?
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: ndesaulniers at google dot com
Target Milestone: ---
Via:
https://lore.kernel.org/all/CAKwvOd=8kxkD9p+WW-F047ShN=r32SLYYfpgZhyDw3BXTDd-KA@mail.gmail.com/
I'm looking to enable -Wmissing-variable-declarations in the Linux kernel
(gcc-14 just gained support for this warning).
In one case I noticed that:
register unsigned long current_stack_pointer asm("rsp");
declared in a header would trigger this:
> no previous declaration for 'current_stack_pointer' [-Wmissing-variable-declarations]
So we could add:
extern unsigned long current_stack_pointer;
before the
register unsigned long current_stack_pointer asm("rsp");
but that seems excessive. Perhaps we can simply not diagnose in that case?
Filed this bug report against clang as well:
https://github.com/llvm/llvm-project/issues/64509
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c/110947] Should -Wmissing-variable-declarations not trigger on register variables?
2023-08-08 15:41 [Bug c/110947] New: Should -Wmissing-variable-declarations not trigger on register variables? ndesaulniers at google dot com
@ 2023-08-08 15:42 ` pinskia at gcc dot gnu.org
0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-08-08 15:42 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110947
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
Last reconfirmed| |2023-08-08
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-08-08 15:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-08 15:41 [Bug c/110947] New: Should -Wmissing-variable-declarations not trigger on register variables? ndesaulniers at google dot com
2023-08-08 15:42 ` [Bug c/110947] " pinskia 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).