Search the web
Sign In
New User? Sign Up
Jal_developers
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
JAL the perfect optimalisation ?   Message List  
Reply | Forward Message #1129 of 1239 |
hi All,

I just encountered the following problem

I've a function "detect_US", which should return true when a valid
US-echo is detected

In the main program I call the function like this
<JAL>
if detect_US then
asynch_send_hw (US_distance)
end if
</JAL>

This worked perfect, at least I thought ;-)

For test purposes, I removed "asynch_send_hw" call
and the result was that about my whole program was optimized away :-(

Strictly speaking, this optimization was a correct action,
because I forgot to set a return value in the function "detect_US".
(The US-distance was also transmitted in another place,
therfor I thought the program worked correctly).
And main problem is that the function detect_US was never called !!

So I think at least it's inconsequent to optimize away or not
the function detect_US,
depending on if the "if-statement" contains any functional code.

It would also be a good idea to give a warning when no return value is
set in a function.

Stef






Tue Aug 23, 2005 9:39 pm

aap_beertje
Offline Offline
Send Email Send Email

Forward
Message #1129 of 1239 |
Expand Messages Author Sort by Date

hi All, I just encountered the following problem I've a function "detect_US", which should return true when a valid US-echo is detected In the main program I...
Stef Mientki
aap_beertje
Offline Send Email
Aug 23, 2005
9:40 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help