Jump to content
  • Advertisement
Sign in to follow this  
milliams

Fixes for various g++ 4.3.2 warnings

This topic is 3484 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

When building angelscript 2.14.1 with g++ 4.3.2, a very large number of warning are produced. There are there different types of warnings which are: # warning: deprecated conversion from string constant to 'char*' # warning: suggest parentheses around && within || # warning: suggest explicit braces to avoid ambiguous ‘else’ I am aware that the latter two of the warnings are not really a problem but the warning is valid in that it can make the code more ambiguous. I've made a patch against 2.14.1 to fix this (http://milliams.com/uploads/as_g++_warning.diff) so feel free to commit it if you want.

Share this post


Link to post
Share on other sites
Advertisement
Thanks milliams,

The first warning would indeed be an error. One that I'm surprised hasn't been caught by any other compiler I've used so far. I'll correct this immediately.

I'm not a big fan of having the compiler suggest how I should write my code, though I realize that these warnings have good cause, as it is a frequent error with inexperienced programmers to forget the precedence of the && and || operators, and also the else statements. I really don't think these extra parentheses and braces are necessary, but I'll add them anyway to make the compiler shut up.

Regards,
Andreas

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!