News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Pragma for disable warnings

Started by Victrix, June 17, 2006, 07:28:47 AM

Previous topic - Next topic

Victrix

Hi all :)

Well, i love set to on all warning compiler flags because then i get more information about my code, im using C::B, MinGW and wxWidgets (on Windows plataform), but when i set on the warning flags (-Wall, -W, -pedantic), the rebuild project take a lot of time (cant remember, but i think more than 1 hour) when the compiler get to "#include <wx/wx.h>" line, there is a way to disable the warnings flags when the compiler reach the "#include <wx/wx.h>" line, maybe a pragma directive, i was looking for in MinGW documentation (GCC Manual and other sources), but couldnt find nothing :( .

For now if i need rebuild project i need to turn off all warning flags and rebuild, but if i forget (lol, i think i forget 4/5) set warnings off i have to close C::B, kill some process not closed when C::B do :( (cc1plus.exe, mingw32-g++.exe) and then reload all again.

Well, thanks in advance for your help.

Sorry by my bad english :P

Vic.

thomas

#1
-Wall is fine, but compiling anything that uses wxWidgets with -pedantic is simply impossible.
Hey, we're talking about wxWidgets...  :lol:

The reason why it takes so long to build your project is that literally gigabytes of warning messages are being piped to the log window during the build.

As a sidenote:
As you all know, compiling wxWidgets from source takes quite some time, too, especially with gcc.
One day, Tiwag gave me the tip to add 1>nul 2>nul to the commandline, so the 15 million warning messages would go down the drain right away instead of being piped to the console.
Guess what: this cuts the build time to one half! :)


EDIT: Sorry, I just saw that I did not answer to the question at all. gcc has no such pragma. What could possibly help is to put everything wx-related into one target (if that's possible) and turn off the -pedantic switch in that target.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Pecan

Quote from: thomas on June 17, 2006, 12:01:19 PM
As a sidenote:
As you all know, compiling wxWidgets from source takes quite some time, too, especially with gcc.
One day, Tiwag gave me the tip to add 1>nul 2>nul to the commandline, so the 15 million warning messages would go down the drain right away instead of being piped to the console.
Guess what: this cuts the build time to one half! :)

Great tip!
thanks


kkez

I suggest to remove the -W flag too, every time you don't initialize a structure member you get a warning...
-Wall is enough, i suppose  :)

Victrix

:( well, ty to all, i just was hope for someone know something else, but like i see, nop, i cant fix the problem :(

Well, ty for your time and your answers.

Vic.