🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Undefined #pragmas are evil

#2863
From: Bill Leonard
Date: Wed, 06 Dec 1995 02:33
50 lines
3279 bytes
In article <sourceDIwJ2M.3DL@netcom.com>, source@netcom.com (David Harmon) writes:
> Any #pragma that is not recognized and supported by an implementation
> _must_ generate a diagnostic!  A pragma that had some important meaning
> when the code was written should not be silently ignored when some new
> compiler doesn't spell it the same way.  This is just plain wrong. 

During the standardization of the Fortran 90 language, there was an effort
(actually, two efforts at different times) to define a directives mechanism
similar to C's pragmas, but much more limited in scope.  We tried to define
some common directives, such as turning on and off listings, that would be
desirable and possible for pretty much every vendor.  Then there would also
be optional directives.  The driving force behind that was the fairly
prevalent practice of vectorizing compilers needing directives to help them
detect opportunities for vectorization.

The effort failed, at least partly because of the issue of what to do if an
implementation didn't recognize the directive.  Most everybody wanted a
diagnostic.  But then someone said, "But suppose my compiler recognizes
somebody else's directive but does something different?"  This degenerated
into a discussion of what it means for a compiler to "recognize" a
directive.  You can guess where that led.

There was some work done in trying to define a naming scheme for
vendor-specific directives, but that failed because the vendors really
wanted to be able to recognize other vendors' directives to enable
portability.  Again, the problem was what does it mean to "recognize"?

Here endeth today's history lesson. :-)

-- 
Bill Leonard
Harris Computer Systems Corporation
2101 W. Cypress Creek Road
Fort Lauderdale, FL  33309
Bill.Leonard@mail.hcsc.com

These opinions and statements are my own and do not necessarily reflect the
opinions or positions of Harris Computer Systems Corporation.

------------------------------------------------------------------------------
There's something wrong with an industry in which amazement is a common
reaction to things going right.

"Hard work never scared me.  Oh, sure, it has startled me from a distance."
                                                       -- Professor Fishhawk
------------------------------------------------------------------------------

[ 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://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID: <4a2iul$ema@hawk.hcsc.com>
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage
References: <9511292357.AA11227@getafix.infosoft.com> <49j043$2ga@engnews1.eng.sun.com> <sourceDIwJ2M.3DL@netcom.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage
From: bill@amber.ssd.hcsc.com (Bill Leonard)
Newsgroups: comp.std.c++
Subject: Re: Undefined #pragmas are evil
Date: 6 Dec 1995 02:33:32 GMT
Organization: Harris Computer Systems, Ft. Lauderdale FL
Approved: clamage@eng.sun.com (comp.std.c++)
Distribution: world
Message-ID: <4a2iul$ema@hawk.hcsc.com>
References: <9511292357.AA11227@getafix.infosoft.com> <49j043$2ga@engnews1.eng.sun.com> <sourceDIwJ2M.3DL@netcom.com>
Reply-To: Bill.Leonard@hawk.hcsc.com
NNTP-Posting-Host: taumet.eng.sun.com
Content-Type: text
X-Nntp-Posting-Host: amber.ssd.hcsc.com
Content-Length: 2349
Originator: clamage@taumet