🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #3263

Re: #ifdef XXXX

#3263
From: Dick Menninger
Date: Mon, 05 Feb 1996 23:31
49 lines
2630 bytes
> =========="Charles F. McDevitt", 2/2/96==========
 
> Marek MAKOWSKI wrote:
 
> > Would not it be sensible to add to the preprocessing a directive
> > that would stop processing the current file ? Something like
 
> > #ifdef XXXX
> > #exit
 
> > this would safe processing (sometimes very long) file in the common
> > situations:
 
> > #ifdef XXXX
> > // a (possibly) long header file hear
> > #endif  /* ifdef XXXX*/
 
 
> Wouldn't it be better to update the C++ standard so the
> default is that include files only get included once, and the
> compiler/preprocessor keeps track of which ones it's already 
> seen.  Then we wouldn't have to mess with these ugly #ifdefs
> to make include files only be included once.

Nothing requires a "header" file to generate the same thing
each time it is included.  For most common uses, that is the
desired semantics, but the current approach allows other
semantic situations to be handled by the existing mechanism
(though the #include is not parameterized, and so "globalish"
name techniques are needed to do other semantics.  But an
include file can be a form of template for source construction
that could be included many times on purpose.  That is what
you are proposing to eliminate.  So you have to debate the
desirability of this style of include file use.  Since C allows it,
this would be a departure in a definite compatibility area.

I express no opinion of the desirability of this.  I am merely
trying to clarify the underlying issues.

Good Day
Dick
Dick.Menninger@DaytonOH.ATTGIS.COM


[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy is
  summarized in http://reality.sgi.com/employees/austern_mti/std-c++/policy.html
]
Technical Details
Message-ID: <DMBrxn.GAB@falcon.daytonoh.attgis.com>
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage
References: <3112531A.3410@ElSegundoCA.ATTGIS.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage
From: Dick Menninger <Dick.Menninger@daytonoh.attgis.com>
Newsgroups: comp.std.c++
Subject: Re: #ifdef XXXX
Date: 5 Feb 1996 23:31:41 GMT
Organization: AT&T Global Information Solutions
Sender: News administrative Login <news@falcon.daytonoh.attgis.com>
Approved: clamage@eng.sun.com (comp.std.c++)
Message-ID: <DMBrxn.GAB@falcon.daytonoh.attgis.com>
References: <3112531A.3410@ElSegundoCA.ATTGIS.COM>
Reply-To: mennid <Dick.Menninger@daytonoh.attgis.com>
NNTP-Posting-Host: taumet.eng.sun.com
Content-Type: text
X-Nntp-Posting-Host: 149.25.123.146
X-Newsreader: DiscussIT 2.5.1.3 for MS Windows [AT&T Software Products Division]
To: undisclosed-recipients.;@daytonoh.attgis.com
Content-Length: 1546
X-Lines: 44
Originator: clamage@taumet