Author Topic: How to change the gcc build error messages format in codeblocks?  (Read 8113 times)

Offline Master

  • Multiple posting newcomer
  • *
  • Posts: 53
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 :
Code
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 :
Code
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 :
Code
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?
« Last Edit: April 20, 2013, 12:37:07 pm by Master »
a man's dream is an index to his greatness...

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: How to change the gcc build error messages format in codeblocks?
« Reply #1 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".

Offline Master

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: How to change the gcc build error messages format in codeblocks?
« Reply #2 on: April 20, 2013, 12:59:36 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...