From: Jeff Sullivan <jps@zk3.dec.com>
Subject: Re: [Help]gcc ignored #pragma pack on DEC/OSF1 4.0B
Date: 1998/01/08 [thread overview]
Message-ID: <34B5490D.3002A3E6@zk3.dec.com> (raw)
In-Reply-To: 68shad$195@dogbert.cc.ndsu.NoDak.edu
Tim Mooney wrote:
>
> One compiler flag that I like to use is `-portable' -- it's a lot like gcc's
> `-Wall', so it turns up a lot of problem areas in code. I have found a
> couple annoyances with using that flag, though.
>
> 1) it warns about `__inline', and stdio.h uses `__inline', so one gets
> screenfulls of warnings for any file that includes stdio.h.
I was unable to reproduce the warnings on either V4.0B or V4.0D.
Can you send me a reproducer (and the compile command) for this?
I know I've seen it before also...
> Is there a #pragma to turn off particular warnings (or even warning
> altogether)?
Again, we've anticipated your desires and you will find much improved
diagnostics capabilities in the DEC C compiler in the upcoming Digital
UNIX V5.0.
You will be able to turn on/off messages via the command line or #pragmas.
In addition, we've gone thru every message and "tuned" what you will see
by default; including new "bug finding" diagnostics like "variable used
before initialized" and other "undefined behavior" warnings.
Also among the many features that I cannot go into here, there is a
feature to turn off diagnostics of this type in "system" header
files. That is, files that you do not have the ability to make
changes to. If you can't fix them, generally you don't want to
see the complaints (as you stated above)...
These features have been well received by our development community
and have even shaken out a few latent bugs in the O/S code.
> 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.
>
> The way I read K&R (2nd ed.) , an enum value is an int. Presumably the
> compiler is warning us that if we plan to port the code to some place where
> an int is 16 bits, we will run into a problem. I guess there might be someone
> out there that finds that useful, but for all of the "spurious" warnings it
> generates on 32 and 64 bit machines (where an int is 32 bits and has a large
> enough range to handle the value) it seems to be more "noise" than it's worth.
I will ask about this, however the ANSI standard says this in section
3.5.2.2, paragraph 40:
"Each enumerated type shall be compatible with an integer type;
the choice of type is implementation-defined."
A simple test should show the DEC C is not limiting you to 16 bits,
but warns about this potential portability issue on other platforms.
> 3) Any chance that the linker will *finally* be fixed so that it doesn't
> dump core when the filesystem fills? ;-)
I'll ask the ld folks about this. I think it may be fixed in V5.0, but
I'd rather not test it myself...
-Jeff
--
Jeff Sullivan | Digital Equipment Corp | sullivan@decc.enet.dec.com
DEC C and C++ | Nashua, NH ZK3-2/2X09 | or jps@zk3.dec.com
next prev parent reply other threads:[~1998-01-08 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 ` 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 [this message]
1998-01-13 5:00 ` Jeff Sullivan
1998-01-16 5:00 ` Tim Mooney
1998-01-05 5:00 ` Jeff Sullivan
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