# Hiding warnings about std::vector, std::string...

This topic is 4401 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi everybody. I'm have almost finished writing my Makefiles for my current project. I have an annoying problem. I activate a bunch of warnings in my gcc options in order to detect things like unreachable code instructions. The problem is that std::vector, std::string and other includes like these contain code which triggers warnings. I obviously don't want to see these warnings but I don't know how to hide them. In gcc manual, when describing the warning about effective c++ warnings, it is said that we must use grev -v to remove unwanted warnings from the stl. However, each of these warnings take more than one line and I don't know how to remove all the unwanted lines. Warnings are like this:
In file included from blabla.cpp,
In file include from blabla.hpp,
In file string.h
Warning: unreachable code in ...


Anybody knows how to not display these warnings ? Thanks.

Anyone ?

##### Share on other sites
I suspect -Wno-unreachable-code will do the trick, but I'm not 100% sure. *edit: Also, warnings in system headers should be ignored by default...-Wno-system-headers could also work if that option got turned on for some reason.

CM

##### Share on other sites
Hi.

In fact, I activated the opposite of -Wno-unreachable-code in order to see when I have unreachable code (you know, when you do some debugging, you sometimes forget to set things back like removing "return;" from function).

About -Wno-system-headers, I already turned this on and it doesn't change anything. I guess gcc doesn't consider vector, string and such ones as system headers.

Anybody has another idea ?

##### Share on other sites

This topic is 4401 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.