On Tue, 2009-01-27 at 21:37 +0100, Florian Weimer wrote:
> * Laurent GUERBY:
> 
> > Just curious: is there a "portable" way to read from memory
> > address zero in C code? "portable" here means likely to work
> > on most compilers without exotic compile flags in 2009.
> 
> No, C hasn't got a notion of addresses.  The situation is likely to
> get even more extreme, not less (in the sense that C continues to be
> perceived as a low-level language, but current implementations really
> aren't).

Are the current GCC optimization currently interfering
with the following "portable" (following my definition) Ada?

with System.Storage_Elements;
procedure P0 is
   X : Integer;
   pragma Volatile (X);
   for X'Address use System.Storage_Elements.To_Address (0);
begin
   X := 0;
end P0;

Laurent


Reply via email to