News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

How to change the gcc build error messages format in codeblocks?

Started by Master, April 20, 2013, 12:34:13 PM

Previous topic - Next topic

Master

Hello every one,
The subject is vague i know it , i couldn't just convey the meaning any better so i explain what i mean .
according to http://gcc.gnu.org/wiki/ClangDiagnosticsComparison#fnref-c80f7dfc6950973199cc4f44ec4ae68de8e7cf2d : gcc now has a better Diagnostics , looking at the examples provided such as :
void foo(char **p, char **q)
{
  (p - q)();
  p();
}


and trying to get the same thing in CB just fails , look at the error provided at gcc comparison page :
t.c:3:10: error: called object is not a function or function pointer
   (p - q)();
          ^
t.c:4:4: error: called object ‘p’ is not a function or function pointer
   p();
    ^
t.c:1:17: note: declared here
void foo(char **p, char **q)
                 ^

and look at the error log generated inside CB :
C:\Users\Master\Documents\CodeBlocks\Test\main.cpp||In function 'void foo(char**, char**)':|
C:\Users\Master\Documents\CodeBlocks\Test\main.cpp|14|error: expression cannot be used as a function|
C:\Users\Master\Documents\CodeBlocks\Test\main.cpp|15|error: 'p' cannot be used as a function|
||=== Build finished: 2 errors, 0 warnings (0 minutes, 11 seconds) ===|


I am using the gcc 4.8, How can i achieve the same behavior in CB? is there any kind of settings  i am missing here?
a man's dream is an index to his greatness...

Jenna

If these errors are thrown by gcc, you should see them in the "Build log"-tab, it shows the raw output of gcc.

However, you will not be able to click them to jump to the error-line.
That can only be done from inside the the "Build messages"-tab.

The output is parsed by regexes. You can change them in "Settinngs -> Compiler -> Global compiler settings -> [the compiler you use] -> Other settings -> Advanced options -> Output parsing".

Master

Quote from: jens on April 20, 2013, 12:49:48 PM
If these errors are thrown by gcc, you should see them in the "Build log"-tab, it shows the raw output of gcc.

However, you will not be able to click them to jump to the error-line.
That can only be done from inside the the "Build messages"-tab.

The output is parsed by regexes. You can change them in "Settinngs -> Compiler -> Global compiler settings -> [the compiler you use] -> Other settings -> Advanced options -> Output parsing".
Thanks alot got it  ;)
a man's dream is an index to his greatness...