This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/80428] Incorrect -Wunused-const-variable= instance
- From: "tom.rini at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 08 May 2017 21:04:14 +0000
- Subject: [Bug c/80428] Incorrect -Wunused-const-variable= instance
- Auto-submitted: auto-generated
- References: <bug-80428-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80428
Tom Rini <tom.rini at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |RESOLVED
Resolution|--- |INVALID
--- Comment #2 from Tom Rini <tom.rini at gmail dot com> ---
OK, digging into this quite hard I found that indeed, during SPL builds for
U-Boot, the code in question (or rather, the functions that use it) are never
referenced, but only some times do we generate the warning, and in other times
we do not. In all cases (again, for U-Boot) we use
-fdata-sections/-ffunction-sections/--gc-sections and discard.
In sum, there is a bug here in that the compiler should have been issuing this
warning in a lot more cases, but I do not have the time / expertise to generate
a stand-alone testcase. As I was reporting this as a warning when it shouldn't
warn, but it turns out to be warning when it should be warning (and _not_
warning when it _should_ be warning), I'm movinv this to resolved/invalid.