[Bug c/59801] GCC does not warn on unused global variable
chengniansun at gmail dot com
gcc-bugzilla@gcc.gnu.org
Tue Jan 14 17:32:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59801
--- Comment #2 from Chengnian Sun <chengniansun at gmail dot com> ---
Thanks for your reply. One more question regarding this issue. Support I have a
closed program
static volatile int a;
int main() {return 0;}
Even though "a" is not read anywhere in this program, do you mean that it is
still possible for "a" to be used somewhere else?
I checked the C standard
draft(http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf). In Page 122,
it says that what constitutes an access to an object that has volatile-qualified
type is implementation-defined. Is this the reason why GCC thinks the variable
is used, but Clang treats it unused?
Thanks again.
More information about the Gcc-bugs
mailing list