VS2010 Compilation Warnings
Hello, using VS2010 I am not getting the compilation warnings I used to get with VS2008.
For example:
float x=1.0;
...would cause a warning in VS2008 because I didn't append an 'f' like so: x=1.0f;
Also, I increased the warning level to 4 under Project->Properties->Configuration Properties/C++ and that gives me additional warnings (but not the warning I detailed above) when I build the whole project but not when I simply compile a file, which is annoying.
Can I set it up so it's similar to the way it used to be ?
Thanks.
Re: VS2010 Compilation Warnings
Is there any very important reason for you to use float type instead of double?
Re: VS2010 Compilation Warnings
Quote:
Originally Posted by
endemoniada
Hello, using VS2010 I am not getting the compilation warnings I used to get with VS2008.
For example:
float x=1.0;
...would cause a warning in VS2008 because I didn't append an 'f' like so: x=1.0f;
What warning did you get in VS2008? (I am not getting any, except for "local variable is initialized but not referenced")
Quote:
Originally Posted by
endemoniada
Also, I increased the warning level to 4 under Project->Properties->Configuration Properties/C++ and that gives me additional warnings (but not the warning I detailed above) when I build the whole project but not when I simply compile a file, which is annoying.
Can I set it up so it's similar to the way it used to be ?
Are you sure? I am getting exactly the same warnings compiling one file. Coud it be that it was up to date and not compiled at all? The behavior is the same in VS2008 and VS2010.
Re: VS2010 Compilation Warnings
Quote:
What warning did you get in VS2008? (I am not getting any, except for "local variable is initialized but not referenced")
I would get a warning such as: "conversion from double to float, possible loos of data". I don't get that in VS2010.
Quote:
Are you sure? I am getting exactly the same warnings compiling one file. Coud it be that it was up to date and not compiled at all? The behavior is the same in VS2008 and VS2010.
Yes, you are correct. The warnings were under Link so they wouldn't show up when it was up to date.
Re: VS2010 Compilation Warnings
Quote:
Originally Posted by
endemoniada
I would get a warning such as: "conversion from double to float, possible loos of data". I don't get that in VS2010.
Could you please post your exact code and compiler warning?
This test:
Code:
int main()
{
float x = 1.0;
double d = 2.0;
x = d;
return 0;
}
produces only one warning (as expected):
Quote:
1>d:\code\2008\test\test\test.cpp(5) : warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
for the assignment x = d;