From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,c818447ef81c263f X-Google-Attributes: gidfee84,public From: Jeff Sullivan Subject: Re: [Help]gcc ignored #pragma pack on DEC/OSF1 4.0B Date: 1998/01/08 Message-ID: <34B5490D.3002A3E6@zk3.dec.com>#1/1 X-Deja-AN: 314234974 Content-Transfer-Encoding: 7bit References: <689ng7$ja2@news.seed.net.tw> <34A918FF.EE41F28F@zk3.dec.com> <6c1zytk51r.fsf@dextrose.atria.com> <34B112CE.6F59@zk3.dec.com> <68shad$195@dogbert.cc.ndsu.NoDak.edu> Content-Type: text/plain; charset=us-ascii Organization: Digital Equipment Corporation Mime-Version: 1.0 Newsgroups: comp.unix.osf.osf1 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