Fixes for various g++ 4.3.2 warnings
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.
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
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
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement