[Bug c/59801] GCC does not warn on unused global variable

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Jan 16 08:38:00 GMT 2014


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59801

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Those two cases are different, the other PR was about automatic volatile
variables, where if they are unused it is really hard to come up with a way how
they could be modified behind compiler's back.  While for this case, variable
in .data/.bss etc. section it is not so hard, the variable has a name through
which it can be referenced, eventhough only from within the same assembly file.
 User could inject some assembly which will access it, the var can use section
attribute that places it into some magic section that is e.g. IO mapped, etc.



More information about the Gcc-bugs mailing list