Jump to content

View more

Image of the Day

Inventory ! Va falloir trouver une autre couleur pour le cadre D: #AzTroScreenshot #screenshotsaturday https://t.co/PvxhGL7cOH
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now
- - - - -

Suggestion: Expression has no effect

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
1 reply to this topic

#1 Friggle   Members   

135
Like
0Likes
Like

Posted 22 October 2010 - 10:45 PM

I just realized that the AngelScript compiler does not seem to warn if an expression has no effect.
Example:


int myVar = 5;

myVar; // Could raise a warning


This is not so much an issue for variable related statements but in case someone wants to call a function and fails to append the paranthesis after the function name the function is not called and no warning is generated.

Example:


void SomeFunction()
{
...
}

SomeFunction; // Would be nice to have a warning raised here.


Just a thought...

Cheers,
Thomas

#2 Andreas Jonsson   Moderators   

4627
Like
0Likes
Like

Posted 23 October 2010 - 12:26 PM

Good point. I'll see if I can have this alert added to the compiler.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.