Article View: gnu.gcc.help
Article #49485Re: controlling gcc warnings
From: Shyamal Prasad
Date: Tue, 25 Jan 1994 17:21
Date: Tue, 25 Jan 1994 17:21
45 lines
2260 bytes
2260 bytes
In article <MAC.94Jan24160913@rhea.chronologic.com> mac@chronologic.com writes:
>
>The extern is a 'useless keyword' in an 'empty declaration'.
>
>It has no meaning whatsoever.
>
>You can save 7 bytes of space by deleting it. Think of all the baby
>bytes that will be so happy that their mommy or daddy was not
>sacrificed (oops, sorry... :-)
>
>If you had typed
>
>extern struct obj foo;
>
>then the extern would have a non empty declaration to refer to (the foo).
>
>but
>
>extern struct obj;
>
Unfortunately I have no way to change the include file. It's supplied
by DEC as part of ULTRIX, and I do not have permits to change these
files on my system (I'm just a poor grad student :-)
What I would like is for gcc to avoid warning me of this sort of
declaration. I think that the empty declaration is allowed in C to
allow incomplete structure declarations. It's useful as a forward
declaration for some structures, so its not always a programming
error, so I figured there must be some way to turn off the warning.
Example:
stuct second;
struct first{ struct second *pt;};
struct second{ struct first *pt;};
(please correct me if I'm wrong - I've never actually done this sort
of thing).
However in this particular include file there is no reason for an
incomplete declaration, but it's there... :-( and gcc freak out.
Shyamal
--
Shyamal Prasad, Department of Computer Science
Southern Methodist University, Dallas TX 75275, USA
Technical Details
Message-ID:
<1994Jan25.172126.2510@seas.smu.edu>Path:
arc1-ca.pugleaf.net!gmd.de!xlink.net!fauern!zib-berlin.de!netmbx.de!Germany.EU.net!EU.net!howland.reston.ans.net!cs.utexas.edu!convex!seas.smu.edu!shyamalReferences:
<1994Jan22.215515.19378@seas.smu.edu> <MAC.94Jan24160913@rhea.chronologic.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,60bcc2a4e25648c7 X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1994-01-25 20:47:11 PST Newsgroups: gnu.gcc.help Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!fauern!zib-berlin.de!netmbx.de!Germany.EU.net!EU.net!howland.reston.ans.net!cs.utexas.edu!convex!seas.smu.edu!shyamal From: shyamal@seas.smu.edu (Shyamal Prasad) Subject: Re: controlling gcc warnings Message-ID: <1994Jan25.172126.2510@seas.smu.edu> Sender: news@seas.smu.edu (USENET News System) Nntp-Posting-Host: rapid_f.seas.smu.edu Organization: SMU - School of Engineering & Applied Science - Dallas References: <1994Jan22.215515.19378@seas.smu.edu> <MAC.94Jan24160913@rhea.chronologic.com> Date: Tue, 25 Jan 1994 17:21:26 GMT Lines: 45