Skip to main content
GameDev.net gamedev.net
🔒 Locked

Fixes for various g++ 4.3.2 warnings

Started by milliams Dec 3, 2008 at 10:55 AM 0 replies 950+ views
Original Post
milliams
milliams
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.
WitchLord
WitchLord
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
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - <a href="http://www.angelcode.com/tower" rel

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.