Explanation, please!

Walter Murray walter at hpcllca.HP.COM
Tue Aug 30 07:04:07 AEST 1988


William E. Davidsen Jr writes:

>This does not seem to be clearly covered in the latest dpANS (section
>3.6). The issue is if it is legal *and defined* to jump into a loop.
>While a case label behaves just like any other label, it's not clear
>what a jump into a loop implies, and I don't see that the existing
>standard is any clearer on the topic than the discussion was three years
>ago.
>
>Please tell me X3J11 didn't let this go unresolved for three
>years.

X3J11 didn't let this go unresolved.

>From 3.1.2.4 Storage duration of objects:

   An object declared with no linkage and without the storage-class
   specifier static has automatic storage duration.  Storage is
   guaranteed to be reserved for a new instance of such an object on
   each normal entry into the block in which it is declared, or on a
   jump from outside the block to a label in the block or in an enclosed
   block.  If an initialization is specified for the value stored in
   the object, it is performed on each normal entry, but not if the
   block is entered by a jump to a label.

>From A.5 Common Warnings:

   A block with initialization of an object that has automatic storage
   duration is jumped into.


Walter Murray



More information about the Comp.std.c mailing list