VS2010 warning level in Introjucer

Discuss topics relating to the Introjucer (or Jucer) application

VS2010 warning level in Introjucer

Postby Leirbag » Sat Apr 07, 2012 2:27 pm

Dear Jules,
Just for curiosity, why Introjucer renders VS projects with /W4 warning level? If I am not wrong, the 'let's say default Microsoft level' is /W3. So, a lot of warnings appears in mode 4.

Gabriel
User avatar
Leirbag
JUCE UberWeenie
 
Posts: 127
Joined: Sun Oct 11, 2009 10:06 am
Location: Madrid

Re: VS2010 warning level in Introjucer

Postby jules » Sun Apr 08, 2012 10:04 am

So, a lot of warnings appears in mode 4.


I think that's a sign that you should fix your code, not reduce the warning level! :wink:
User avatar
jules
Fearless Leader
 
Posts: 17193
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK

Re: VS2010 warning level in Introjucer

Postby Leirbag » Sun Apr 08, 2012 10:39 am

Coming from you is certainly a great tip. We will listen.

Thanks,

Gabriel
User avatar
Leirbag
JUCE UberWeenie
 
Posts: 127
Joined: Sun Oct 11, 2009 10:06 am
Location: Madrid

Re: VS2010 warning level in Introjucer

Postby TheVinn » Sun Apr 08, 2012 3:29 pm

jules wrote:I think that's a sign that you should fix your code, not reduce the warning level! :wink:


What is your approach to dealing with double <--> float <--> int conversion warnings about loss of data, even when you know that the calculation is right as-is? I don't see a whole bunch of static_cast<> with numeric types in the Juce code...
Open Source: LayerEffects, VFLib, SimpleDJ, DSP Filters, LuaBridge, JUCE, FreeType, TagLib
"This isn't a big project, it shouldn't take long." - Jules
User avatar
TheVinn
JUCE UberWeenie
 
Posts: 2975
Joined: Sat Aug 29, 2009 11:31 am
Location: Marina del Rey, California

Re: VS2010 warning level in Introjucer

Postby chkn » Mon Apr 09, 2012 10:47 am

even when you know that the calculation is right as-is?

But there is nothing right "as-is" when you for example assign a double to a float var. Than the compiler has to cast them to another type, this should be an error not a warning imho.
So whats wrong with good old c-style (float) (int) (double) casts, for those elementary types? Doing it explicit and the compiler doesn't has to guess.
chkn
JUCE UberWeenie
 
Posts: 864
Joined: Thu Mar 08, 2007 6:17 pm

Re: VS2010 warning level in Introjucer

Postby jules » Mon Apr 09, 2012 3:59 pm

What is your approach to dealing with double <--> float <--> int conversion warnings about loss of data, even when you know that the calculation is right as-is? I don't see a whole bunch of static_cast<> with numeric types in the Juce code...


In code where it's a totally straightforward primitive-numeric-type-to-other-primitive-numeric-type cast, then I do tend to just use an old-fashioned C cast, because in that case static_cast just makes the code more long-winded without adding anything useful. But of course if there's any chance that templates or non-primitive types are involved, a static_cast would always be best.
User avatar
jules
Fearless Leader
 
Posts: 17193
Joined: Mon Sep 06, 2004 9:03 am
Location: London, UK


Return to The Introjucer/Jucer

Who is online

Users browsing this forum: No registered users and 2 guests