Author Topic: missing warning messages  (Read 3192 times)

Offline larsjo

  • Single posting newcomer
  • *
  • Posts: 6
missing warning messages
« on: March 20, 2015, 04:26:06 pm »
I take this program, test.c:
int main(){ }
and compile with the command line:
$/cygdrive/c/Program\ Files/CodeBlocks/MinGW/bin/mingw32-gcc.exe   -Wall test.c
Then the following warning message shows:
test.c:1: warning: control reaches end of non-void function

This is all very well. However, when I compile the same code in Code::Blocks (v.10.05) it says "0 errors, 0 warnings". I do think this deserves a warning message, and it should show since CodeBlocks uses the same compiler as I did at the command line call.

I have checked the  -Wall  square at three locations:
The first two by going in to the menu bar: Project > Build options...
To the left I mark "Debug" and check the -Wall-square
and then I, to the left, mark the "root" and check the -Wall-square

Finally I once more go to the menu bar: Settings > Compiler and debugger...
and again I check the -Wall-square.

What more is necessary to make the warning show up?

Some warning messages show up anyway, but somehow not all those that should.






Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: missing warning messages
« Reply #1 on: March 20, 2015, 08:37:16 pm »
Why don't you try some of the two newer versions of codeblocks (12.05 or 13.12)?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline larsjo

  • Single posting newcomer
  • *
  • Posts: 6
Re: missing warning messages
« Reply #2 on: March 20, 2015, 08:50:14 pm »
This is the version installed at my university.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: missing warning messages
« Reply #3 on: March 20, 2015, 08:51:50 pm »
What is -WAll-square?

BTW: Tell them to update, it is almost free:)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline frithjofh

  • Regular
  • ***
  • Posts: 376
Re: missing warning messages
« Reply #4 on: March 20, 2015, 09:02:23 pm »
i think he means the tick-mark, where up enable/disable this option... its kind of square... the wxCheckBox
architect with some spare time  -  c::b compiled from last svn  -   openSuSE leap x86_64  -  AMD FX-4100

Offline larsjo

  • Single posting newcomer
  • *
  • Posts: 6
Re: missing warning messages
« Reply #5 on: March 20, 2015, 09:06:00 pm »
frithjofh is right. That is what i mean. The checkboxes.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: missing warning messages
« Reply #6 on: March 20, 2015, 09:25:37 pm »
Hm, have you checked the full log?

See this page http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F to see how to enable it .

Inspect the log and see if the option is passed correctly. Keep in mind that if the compiler is newer than the release of CB it might not be fully supported, because its output has changed.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline larsjo

  • Single posting newcomer
  • *
  • Posts: 6
Re: missing warning messages
« Reply #7 on: March 21, 2015, 07:13:40 am »
I am at home now, but I have the same problem here. Anyway, I looked where oBFusCATed pointed and followed the advice. At the menu-bar I selected
Settings > Compiler and debugger...
I made sure that "Global compiler settings" was marked in the field to the left.  Then I selected the tab "Other settings". There I could set "Compiler logging" to "Full command line".

And it worked  :)

The command line statement was shown in the build log
(and it started with  gcc -Wall -g -Wall -g -Wall -g ...  so the checkboxes were thoroughly checked :)  )

And the warning message showed...

Many thanks to oBFusCATed.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: missing warning messages
« Reply #8 on: March 21, 2015, 11:28:17 am »
Enabling the full logging should not magically make cb to show the warnings.
Do you see them in the build messages tab?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline larsjo

  • Single posting newcomer
  • *
  • Posts: 6
Re: missing warning messages
« Reply #9 on: March 21, 2015, 11:39:07 am »
Yes I do. The warnings are displayed both in "Build log" and in "Build messages".

Offline larsjo

  • Single posting newcomer
  • *
  • Posts: 6
Re: missing warning messages
« Reply #10 on: March 23, 2015, 06:54:49 am »
oBFusCATed was right in his/her last skeptical remark. At school i made the same change. The effect was that the command line options showed up in "Build messages". But the end result was "No errors, no warnings".

However, in "Global compiler settings" (reached through  "Settings > Compiler and debugger ..."), under the tab "Other options" I found some old leftovers. The option "-std=c99" was there, so I removed it. After that the warning was shown: "control reaches end of non-void function".

So now I am happy again. :)