comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic" <mcondic.auntie.spam@acm.org>
Subject: Re: Keyword "null" Question
Date: Sat, 18 Jan 2003 09:46:50 -0500
Date: 2003-01-18T14:47:50+00:00	[thread overview]
Message-ID: <b0bpem$phs$1@slb6.atl.mindspring.net> (raw)
In-Reply-To: 3E281B97.76F47E30@noSpam.raytheon.com

That's going to depend on the optimizer for your particular compiler. The
language only specifies that in some "virtual machine" sense, nothing
happens that impacts your program - timing issues not being considered. I
believe that it is possible for the optimizer to look at the whole "if"
statement and throw it away - but I could be wrong about this. (I have not
had to review that aspect of the standard for some time.) That could have
implications if the logical expression in the "if" had side effects.
(Someone with better knowledge than I have might want to correct this...)

You need to check the output of your compiler with various optimization
levels set. Note that it is legal for a compiler to do something illegal
while optimizing just so long as there is some mode in which the compiler
does what the ARM requires. (IOW, if optimizing away the if chech were
illegal, it still might be made to do so in some optimization mode, so long
as in some "Standard Ada" mode it does not.)

MDC
--
======================================================================
Marin David Condic
I work for: http://www.belcan.com/
My project is: http://www.jast.mil/

Send Replies To: m c o n d i c @ a c m . o r g

    "I'd trade it all for just a little more"
        --  Charles Montgomery Burns, [4F10]
======================================================================

Michael Bustillo <Michael_B_Bustillo@noSpam.raytheon.com> wrote in message
news:3E281B97.76F47E30@noSpam.raytheon.com...
> While reviewing the Ada LRM, it makes note that the Ada keyword "null"
> does nothing except pass to the next statement.  This seems intuitive
> enough, however...
>
> I'm currently attempting to reverse engineer some code so that it can be
> converted to another language, and I've run across the following:
>
>     if SOME_EVENT_TOOK_PLACE then
>         null;
>     end if;
>
> This statement is simply standing alone by itself, not part of any
> "case-like" structure or anything sneaky.  I guess my question is when
> it says "...it does nothing..." does it actually mean that it is putting
> a NO OP there?  Because then this would actually be doing something,
> most likely a timing issue, and that's what I need to know.
>
> I appreciate your time, and thanks.
>





      parent reply	other threads:[~2003-01-18 14:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-17 15:04 Keyword "null" Question Michael Bustillo
2003-01-17 15:10 ` Lutz Donnerhacke
2003-01-17 23:16   ` Jeffrey Carter
2003-01-17 15:46 ` Mark Johnson
2003-01-17 16:35 ` Peter Amey
2003-01-17 17:31   ` Pascal Obry
2003-01-17 17:40     ` Larry Kilgallen
2003-01-17 18:16   ` Warren W. Gay VE3WWG
2003-01-18  2:54 ` Steve
2003-01-18 14:46 ` Marin David Condic [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox