Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: danpop@mail.cern.ch (Dan Pop)
Subject: Re: Compiler flags of dubious utility.
Date: 1995/12/15	[thread overview]
Message-ID: <danpop.819061389@rscernix> (raw)
In-Reply-To: 4aqnhp$dpn@usenet.pa.dec.com

In <4aqnhp$dpn@usenet.pa.dec.com> mogul@pa.dec.com (Jeffrey Mogul) writes:

>Possible pragmas:
>	#pragma pointer_size (short)
>means declarations use 32-bit pointers until otherwise specified
>	#pragma pointer_size (long)
>means declarations use 64-bit pointers until otherwise specified
>	#pragma pointer_size (save)
>saves current pointer-size on a stack of some sort
>	#pragma pointer_size (restore)
>pops the stack value
>
>(It's not my fault that they used "short" here to mean "32 bits".)
>
>As far as I can tell, "-xtaso_short" really means "-xtaso, but
>also insert a #pragma pointer_size (short) at the start of the
>module."  As you've found out, this is not such a good idea because
>most modules include header files that declare structures that
>are shared with 64-bit library routines.

The idea is good, the implementation of the system header files is bad :-(

>Generally, sticking a "#pragma pointer_size (short)" after all
>the system #includes does the right thing. 

No, this is a workaround.  The right thing would have been for the
header files to protect the sensitive declarations with:

#pragma pointer_size (save)
#pragma pointer_size (long) 
...
#pragma pointer_size (restore)

and avoid the programmer the need for messing with these pragmas in his
code.

Ditto for the char **argv issue, which is trivial to implement within
the compiler (the second and third arguments of main are handled as
special cases) or, even better, in the startup module, which could
build the right type of pointer arrays, according to the actual type of
argv and envp.

Dan
--
Dan Pop
CERN, CN Division
Email: danpop@mail.cern.ch 
Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland



  reply	other threads:[~1995-12-15  5:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-12-12  5:00 Compiler flags of dubious utility Ron Natalie
1995-12-12  5:00 ` Dan Pop
1995-12-12  5:00   ` Ron Natalie
1995-12-12  5:00     ` Ron Natalie
1995-12-15  5:00       ` Jeffrey Mogul
1995-12-15  5:00         ` Dan Pop [this message]
1995-12-15  5:00         ` Dan Pop
read-only archive

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