Author Topic: Remove specific warning messages from compiler output  (Read 5845 times)

Offline pozzugno

  • Multiple posting newcomer
  • *
  • Posts: 39
Remove specific warning messages from compiler output
« on: October 20, 2011, 11:42:41 am »
Dear forum,

I'm using a compiler that doesn't allow me to disable specific warning messages through command line options. Now I'm interested to increase the level of warning messages output from compiler, but many messages aren't useful to me and I'd like to remove them.

Can C::B remove automatically the lines from compiler output that contain specific word (like W10298) at a project level (in the Project->Build Options window)? I tried but without success. Alternatively, is it possible at global level (in Settings->Compiler and debugger window)?

Another alternative could be the use of "grep -v" command. How can I pipe the compiler output to grep at a project level or global level?

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Remove specific warning messages from compiler output
« Reply #1 on: October 20, 2011, 12:06:19 pm »
If you use a recent version of C::B (if I remember correctly after 10.05 release, aka nightly build), you can add words to ignore to "Settings -> Compiler and debugger -> Global compiler settings -> Other settings -> Compiler output to be ignored".

As far as I know, it's global for all compilers.

Offline pozzugno

  • Multiple posting newcomer
  • *
  • Posts: 39
Re: Remove specific warning messages from compiler output
« Reply #2 on: October 20, 2011, 12:41:25 pm »
If you use a recent version of C::B (if I remember correctly after 10.05 release, aka nightly build), you can add words to ignore to "Settings -> Compiler and debugger -> Global compiler settings -> Other settings -> Compiler output to be ignored".

As far as I know, it's global for all compilers.
I found this option in 10.05 release and you were right, this option is global for all compilers... too bad  :(

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Remove specific warning messages from compiler output
« Reply #3 on: October 20, 2011, 01:10:26 pm »
I found this option in 10.05 release and you were right, this option is global for all compilers... too bad  :(
So what? I guess not many compilers issue a "W10298" warning. So the question is, whether you can apply a filter that is active for your compiler, only.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline pozzugno

  • Multiple posting newcomer
  • *
  • Posts: 39
Re: Remove specific warning messages from compiler output
« Reply #4 on: October 20, 2011, 02:56:03 pm »
So what? I guess not many compilers issue a "W10298" warning.
I'm sorry, in my original post there was just an example. I'm interested to disable many warning messages like the following:
  W1049C
  W1107C
  W1264C
and so on. I don't know if they are common warning codes that other compilers may use.

So the question is, whether you can apply a filter that is active for your compiler, only.
Yes, it could be a better solution: specify a filter for a specific compiler and not for all (I think remove the same message for all compiler isn't often useful). But it seems the option "Compiler output to be ignored" is a "Compiler-indipendent option".


Offline Freem

  • Almost regular
  • **
  • Posts: 218
Re: Remove specific warning messages from compiler output
« Reply #5 on: October 23, 2011, 03:56:14 pm »
You ask for how to pipe the result of the compiler into the grep...
I never used it, but, maybe in:
settings -> compiler -> other settings -> advanced options -> [warning] -> command ?
But it will also affect all your compiler and projects...

I thought also about about another possibility I have never used, the scripting:
project properties -> build scripts
But I really don't know what they can do...