Skip to main content
gamedev.net
🔒 Locked

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

Started by sebarnolds 2 replies 750+ views
Original Post
sebarnolds
sebarnolds
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.
Lead programmer of the (slowly evolving) syBR game engine --- http://sybr.sourceforge.net
sebarnolds
sebarnolds
Anyone ?
Lead programmer of the (slowly evolving) syBR game engine --- http://sybr.sourceforge.net
Conner McCloud
Conner McCloud
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
sebarnolds
sebarnolds
Hi.

Thanks for your reply.

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 ?
Lead programmer of the (slowly evolving) syBR game engine --- http://sybr.sourceforge.net

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.