Nikos Chantziaras
unread,Oct 5, 2012, 8:35:00 AM10/5/12You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to help-gp...@gnu.org
GCC doesn't produce "unused variable" warnings for 'vec' and 'str' in
the code below:
#include <vector>
#include <string>
int main()
{
std::vector<char> vec;
std::string str;
char c;
}
When compiling this with either GCC 4.6.3 or 4.7.2, I only get:
$ g++ -Wall -W main.cpp
main.cpp: In function 'int main()':
main.cpp:8:14: warning: unused variable 'c' [-Wunused-variable]
It catches 'c' as being unused, but not 'vec' and 'str'. Is this on
purpose, or did I run across a bug?