Author Topic: Warning counted like error. Help to configure the enviroment  (Read 5505 times)

Offline yczo

  • Single posting newcomer
  • *
  • Posts: 8
Hello, I'm starting to use codeblocks like c/c++ IDE, over linux.

The issue is the next. This sort of warning is counted like an error.
Quote
/home/enigma/programas_C/SeriesDeNum_Partidos_1/main.cpp|12|warning: deprecated conversion from string constant to ‘char* [-Wwrite-strings]|
/home/enigma/programas_C/SeriesDeNum_Partidos_1/main.cpp|20warning: deprecated conversion from string constant to ‘char* [-Wwrite-strings]|
/home/enigma/programas_C/SeriesDeNum_Partidos_1/main.cpp|28|aviso: warning: deprecated conversion from string constant to ‘char* [-Wwrite-strings]|
||=== Build finished: 3 errors, 0 warnings (0 minutes, 0 seconds) ===|

Please, could anyone help me to configure the editor to count like warning instead?

Thanks in advance.
« Last Edit: June 23, 2013, 11:12:08 pm by yczo »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7339
    • My Best Post
Re: Warning counted like error. Help to configure the enviroment
« Reply #1 on: June 23, 2013, 10:36:01 pm »
Code::Blocks verion or SVN number?

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline yczo

  • Single posting newcomer
  • *
  • Posts: 8
Re: Warning counted like error. Help to configure the enviroment
« Reply #2 on: June 23, 2013, 10:42:08 pm »

codeblocks-12.11 over gcc-4.6.3

salutes!

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Warning counted like error. Help to configure the enviroment
« Reply #3 on: June 23, 2013, 10:50:29 pm »
Please post the exact message from the "Build log" and not from the "Build message"-pane.
And use code-tags (look at the hash [ # ] in the tools-list) to enhance readability.
« Last Edit: June 23, 2013, 10:54:53 pm by jens »

Offline yczo

  • Single posting newcomer
  • *
  • Posts: 8
Re: Warning counted like error. Help to configure the enviroment
« Reply #4 on: June 23, 2013, 11:11:04 pm »
Quote
-------------- Build: Debug in SeriesDeNum_Partidos_1 (compiler: GNU GCC Compiler)---------------

g++ -Wall -fexceptions  -g  -g    -c /home/yczo/programas_C/SeriesDeNum_Partidos_1/main.cpp -o obj/Debug/main.o

/home/yczo/programas_C/SeriesDeNum_Partidos_1/main.cpp: In function ‘int main()’:
/home/yczo/programas_C/SeriesDeNum_Partidos_1/main.cpp:12:41: warning: deprecated conversion from string constant to ‘char* [-Wwrite-strings]
/home/yczo/programas_C/SeriesDeNum_Partidos_1/main.cpp:20:48: warning: deprecated conversion from string constant to ‘char* [-Wwrite-strings]
/home/yczo/programas_C/SeriesDeNum_Partidos_1/main.cpp:28:41: warning: deprecated conversion from string constant to ‘char* [-Wwrite-strings]
g++  -o bin/Debug/SeriesDeNum_Partidos_1 obj/Debug/main.o obj/Debug/tabula.o   -lcurses  
Output size is 10,60 KB
Process terminated with status 0 (0 minutes, 0 seconds)
3 errors, 0 warnings (0 minutes, 0 seconds)

Note: The program runs even with the errors
« Last Edit: June 23, 2013, 11:13:57 pm by yczo »

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Warning counted like error. Help to configure the enviroment
« Reply #5 on: June 23, 2013, 11:30:53 pm »
You can test it yourself in:
"Settings -> Compiler -> Global compiler settings -> [your compiler] -> Other settings -> Advanced options -> output parsing"

The first wanrning line gives me (rev 9156 from my repo):
Code
Regular expression analyzed as follows:

Type: Warnung message
Filename: /home/yczo/programas_C/SeriesDeNum_Partidos_1/main.cpp
Line number: 12
Message: warning: deprecated conversion from string constant to ‘char* [-Wwrite-strings]

I'm not absolutely sure, but if I remember correctly, we did not change the regexes since 12.11 release.
Did you ever play with the regexes ?
You can reset them to the defaults, but changes you have made will be lost then, of course.