Sign in to follow this  

Fixes for various g++ 4.3.2 warnings

This topic is 3295 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
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

This topic is 3295 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this