🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #52415

Re: fixincludes

#52415
From: Joe Buck
Date: Wed, 16 Sep 1992 21:07
43 lines
2582 bytes
In article <1992Sep16.163453.6359@erg.sri.com> hight@sri.com (John Hight) writes:
>Well, I'm getting close to completing installation of 2.2.2 on a
>sparc, but I'm somewhat disturbed by the function prototypes in the
>header files that were installed via "make install-fixincludes".
>Specifically, all the arguments to system functions are encapsulated
>in comments.  Why is this done?

Sun did it; these files are simply copies of the Sun headers with some
errors fixed.  The reason they are commented out is because Sun's bundled
compiler does not know about prototypes.  The Gnu folks didn't write those
files.

Sun charges extra for an ANSI C compiler; the one they give you is an
old-fashioned K&R one with a Reiser-style C preprocessor (see below).

>I certainly do not understand the following section in INSTALL
>describing the installation of corrected header files, specifically
>the second sentence "This behavior".  Can anyone explain this to me,
>with an example?  Is this why all the header files have the arguments
>commented out?  Specifically, what will -traditional do?

|     Various system header files often contain constructs which are
|     incompatible with ANSI C, and they will not work when you compile
|     programs with GNU CC.  This behavior consists of substituting for
|     macro argument names when they appear inside of character
|     constants.  The most common offender is `ioctl.h'.
|
|     You can overcome this problem when you compile by specifying the
|     `-traditional' option.

The so-called "Reiser cpp" would permit macros of the form

#define CONTROL(c) ('c' & 0x1f)

and the c would be substituted, even though it's inside single quotes.
The ANSI C standard says this is illegal.  There are several other forms
of traditional C preprocessor weirdness that are also now forbidden.
Many versions of "ioctl.h" rely on features like these.



--
Joe Buck	jbuck@ohm.berkeley.edu
Technical Details
Message-ID: <1987mmINNg6j@agate.berkeley.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!nigel.msen.com!caen!uakari.primate.wisc.edu!ames!agate!forney.berkeley.edu!jbuck
References: <1992Sep16.163453.6359@erg.sri.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,c96a18af54ff3b7c
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1992-09-16 08:29:06 PST
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!nigel.msen.com!caen!uakari.primate.wisc.edu!ames!agate!forney.berkeley.edu!jbuck
From: jbuck@forney.berkeley.edu (Joe Buck)
Newsgroups: gnu.gcc.help
Subject: Re: fixincludes
Date: 16 Sep 1992 21:07:34 GMT
Organization: U. C. Berkeley
Lines: 43
Message-ID: <1987mmINNg6j@agate.berkeley.edu>
References: <1992Sep16.163453.6359@erg.sri.com>
NNTP-Posting-Host: forney.berkeley.edu