Author Topic: Pragma for disable warnings  (Read 6428 times)

Offline Victrix

  • Single posting newcomer
  • *
  • Posts: 6
Pragma for disable warnings
« on: June 17, 2006, 07:28:47 am »
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.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Pragma for disable warnings
« Reply #1 on: June 17, 2006, 12:01:19 pm »
-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.
« Last Edit: June 17, 2006, 12:21:56 pm by thomas »
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2778
Re: Pragma for disable warnings
« Reply #2 on: June 17, 2006, 01:58:59 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


Offline kkez

  • Almost regular
  • **
  • Posts: 153
    • WinapiZone
Re: Pragma for disable warnings
« Reply #3 on: June 17, 2006, 02:01:15 pm »
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  :)

Offline Victrix

  • Single posting newcomer
  • *
  • Posts: 6
Re: Pragma for disable warnings
« Reply #4 on: June 18, 2006, 01:13:29 am »
:( 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.