Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: mooney@dogbert.cc.ndsu.NoDak.edu (Tim Mooney)
Subject: Re: [Help]gcc ignored #pragma pack on DEC/OSF1 4.0B
Date: 1998/01/16	[thread overview]
Message-ID: <69n3rl$ivm@dogbert.cc.ndsu.NoDak.edu> (raw)
In-Reply-To: 34BBE9F2.5BC239F@zk3.dec.com


[posted and cc'ed]

In article <34BBE9F2.5BC239F@zk3.dec.com>,
Jeff Sullivan  <jps@zk3.dec.com> wrote:
> Tim Mooney wrote:
> > 
> > 1) it warns about `__inline', and stdio.h uses `__inline', so one gets
> 
> I have verified that this is fixed in Digital UNIX V4.0D.
> To test this:
> 
> % cat t.c
> #include <stdio.h>
> % cc -portable t.c -fast -w0 -c
> 
> In this case, -fast expands to (among other things) -D_INTRINSICS
> -D_INLINE_INTRINSICS, which will cause the __inline functions to
> be enabled in stdio.h.
> 


Thanks Jeff!  I unfortunately hadn't had time to isolate the combination of
arguments that was causing this when used with `-portable'  -- I appreciate
you taking the time to investigate this.


> > 2) It warns about this:
> >         GTK_HAS_SHAPE_MASK   = 1 << 22
> > in an enum:
> > 
> >          In this declaration, the enumeration constant GTK_HAS_SHAPE_MASK
> > is out of the range -32768 to 32767.
> 
> Our project leader wrote:
> 
> "
> Hmm, I believe Tim Mooney is correct


I hear that all the time from *my* boss too.  ;-)


> about the enum.  The only platforms
> to which this enumeration constant would be non-portable (under
> ANSI C) would be ones on which the type int had fewer than 23 bits.
> If -portable complains about this, then it ought to complain
> about every int constant that exceeds 16 bits (since that's the
> minimum size for int required by the standard).  It might be
> the case that some compilers implemented enums as 16 bits
> even though they had 32-bit ints, and perhaps that's why this
> message exists.  But our general basis for portability is ANSI C,
> and the only way an ANSI compiler could reject this is on the
> basis of the size of int - and we don't complain about other
> constructs that assume int is at least 32 bits.
> 
> The section you quote "Each enumerated type shall be compatible with an
> integer type; the choice of type is implementation-defined." ends with
> a comma instead of a period.  It goes on to say: "but shall be
> capable of representing the values of all the members of the
> enumeration".  The intent here is to allow the compiler to
> look at the list of enum values for a particular enum type,
> and choose the integer type with which it will be compatible
> based on the values.  E.g. for enum bool {TRUE, FALSE} the
> compiler could choose char and only allocate a byte.  But
> for enum x {y = 1<<22}, the compiler must choose a type
> large enough to hold 1<<22, unless 1<<22 is not a value
> that can be represented by the type int.
> "
> 
> At your suggestion, with sustaining votes from our group, the change
> will be in the DEC C compiler in Digital UNIX V5.0.
> 
> Thanks for your comments on DEC C.

Thanks Jeff, and thanks also to your project leader.  I appreciate the
time and effort you've invested on these issues.

Tim
-- 
Tim Mooney                              mooney@dogbert.cc.ndsu.NoDak.edu
Information Technology Services         (701) 231-1076 (Voice)
Room 242-J1, IACC Building              (701) 231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164



      reply	other threads:[~1998-01-16  5:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-12-30  5:00 [Help]gcc ignored #pragma pack on DEC/OSF1 4.0B Ming-Yen Hsu
1997-12-30  5:00 ` Jeff Sullivan
1997-12-31  5:00   ` John Kohl
1998-01-05  5:00     ` Jeff Sullivan
1998-01-05  5:00     ` Joe Mario
1998-01-06  5:00       ` Tim Mooney
1998-01-06  5:00         ` Kevin Jacobs
1998-01-08  5:00           ` Jeff Sullivan
1998-01-08  5:00         ` Jeff Sullivan
1998-01-13  5:00         ` Jeff Sullivan
1998-01-16  5:00           ` Tim Mooney [this message]
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