Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

enabling "set but unused" warning

18 views
Skip to first unread message

kena...@gmail.com

unread,
Apr 14, 2013, 7:35:39 PM4/14/13
to
I've seen numerous posts regarding disabling the "set but unused" warning message. I'm having the opposite problem; I can't get this warning to occur. Given the simple program

/* test.C */
int main() {

int x;
x = 1;
printf("hi\n");

return 0;

}

Compiling this with g++ 4.4.0 (the latest we have installed for official builds) and using 'Wall -Wextra' I get no compiler warning about the 'x = 1'. I even specified '-Wunused' but still no warning. I need this warning to preempt warnigns generatied by our code analysis program (Coverity).

I've seen in some other posts that g++ 4.6.0 has this warning as default, but that's not an option. Is there any way to enable this using the level of g++ we have installed?

InuY4sha

unread,
Oct 30, 2013, 8:06:40 AM10/30/13
to
I see it's missing in 4.8.0, so maybe it is a long-time-ago-filed bug?
http://gcc.1065356.n5.nabble.com/Bug-middle-end-55271-New-missing-warning-set-but-unused-td887326.html
0 new messages