[M3devel] interesting osf cc option for uninitialized variables
Rodney M. Bates
rodney_bates at lcwb.coop
Sun Jun 13 17:08:15 CEST 2010
Jay K wrote:
> -trapuv
> Forces all uninitialized stack variables to be initialized with
> 0xfff58005fff58005. When this value is used as a floating-point vari-
> able, it is treated as a floating-point NaN and causes a floating-point
> trap. When it is used as a pointer, an address or segmentation viola-
> tion usually occurs.
In the case of a pointer, doing this would violate the Modula-3 language rule
that all variables are initialized to a bit pattern that represents a valid
member of the variable's type. For a pointer, this would have to be either
the address of an allocated heap object or NIL. Only the NIL makes any sense.
I like the idea for floats, though, and I consider a NaN to be a valid member
of the type.
>
>
> Relates to recent discussion.
> This should probably be how longreals are initialize for this target.
> Though in reality I'm not very motivated to make this target esp. better than any others.
> It is interesting to see though what features people have put into C compilers.
>
>
> - Jay
>
>
>
>
>
>
More information about the M3devel
mailing list