News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Loss of Data Warning

Started by wolfcry, February 12, 2011, 03:54:53 PM

Previous topic - Next topic

wolfcry

Hello,

Not sure if this goes in the bug section or not (most likely a setting I changed without realizing) but C::B is no longer issuing me warnings about possible loss of data due to unsafe conversion types (eg. double to int conversion etc.) and I could have sworn it did before I went to 10.5.

I checked the compiler flag options in the Settings >> Compiler and debugger section and I do have enable all compiler warnings checked as well as all other warning options checked (over-the-top I know but I'm extremely picky about clean code).

I tested my compiler (Mingw-g++) using a different IDE and it kicks the warning out like it was supposed to so I know it's not that. Just not sure where in C::B this is being filtered out.

For example, this tid bit should kick out the warning like it does with the other IDE but it doesn't:

double a = 8.5;
int d = a;


C::B version and OS is in my sig as always.
C::B Version = 10.5
OS = Microsquish XP

stahta01

#1
http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

Edit: Only compare a re-build to a Re-Build; never a build to a build.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

wolfcry

Hey Stahta01 and thanks for the help.

I'm not exactly sure why (unless updating C::B erased my additional option settings), but the other options (including Wconversion which should be a default option flag in C::B or at the very least, an option you can set), were gone.

I had already viewed the build log before posting (and was mistakingly thinking another option was the flag I was looking for lol) but didn't realize -Wconversion was missing until looking over the log for the umpteenth time :? Oi is all I can say about that one lol.

For those new to C::B and for those that want this warning, you set the -Wconversion flag at (hopefully this helps):
Settings >> Compiler and debugger >> Other Settings (tab directly to the right of Compiler Flags tab).




C::B Version = 10.5
OS = Microsquish XP