News:

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

Main Menu

missing warning messages

Started by larsjo, March 20, 2015, 04:26:06 PM

Previous topic - Next topic

larsjo

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.






oBFusCATed

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!]

larsjo

This is the version installed at my university.

oBFusCATed

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!]

frithjofh

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

larsjo

frithjofh is right. That is what i mean. The checkboxes.

oBFusCATed

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!]

larsjo

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.

oBFusCATed

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!]

larsjo

Yes I do. The warnings are displayed both in "Build log" and in "Build messages".

larsjo

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. :)