🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2017

Order to pragma chaos (was Re: Another sizeof question)

#2017
From: Erkki Ruohtula
Date: Fri, 23 Nov 1990 12:50
34 lines
2568 bytes
In article <12570055@hpclscu.HP.COM> shankar@hpclscu.HP.COM (Shankar Unni) writes:
   Thus the only reasonable approach is to say that a "#pragma" can change the
   behavior of a program in really unspecified ways (unless you want to get
   into the business of standardizing specific pragmas, like Ada does).

I think that to some extent, this might be a good idea. The problem with
pragmas is that although many compilers have similar special features,
the ways to invoke them differ. Disabling structure alignment is a good
example. One compiler I know expects "#pragma noalign", another
"#pragma pack".

There could be a clearing-house where implementors could send questions
like "I want to add a special feature X. What kind of a pragma (if any) has
been used for it before? if none, I intend to use #pragma ZZZ".
The clearing-house would send back either a suggestion about an existing
pragma, or tell the implementor to go ahead with his own idea (and archive
it for later queries). It would have the process these queries fairly
quickly to be useful, but this is possible if we stick to the idea that
the implementors suggestions for new pragmas are accepted without worldwide
discussion.

Implementors would also be asked to report if they improve the pragma they got
(for example, in the pack case, adding an optional number to specify that data
must be aligned to offsets divisible by that number should be reported).
The collected pragmas would be viewed as recommendations, not part of the
standard.

I believe this kind of arrangement could reduce unnecessary incompatibility
in the areas that fall outside the scope of the standard.
--
Erkki Ruohtula     / Nokia Telecommunications
eru@tele.nokia.fi / P.O. Box 33 SF-02601 Espoo, Finland
Disclaimer: These are my private opinions and do not represent the position
            of Nokia Telecommunications.
Technical Details
Message-ID: <ERU.90Nov23145007@tnvsu1.tele.nokia.fi>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!sun-barr!cs.utexas.edu!sdd.hp.com!usc!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!news.funet.fi!funic!fuug!mjolner!newshost!eru
References: <13171@crdgw1.crd.ge.com> <12570055@hpclscu.HP.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!sun-barr!cs.utexas.edu!sdd.hp.com!usc!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!news.funet.fi!funic!fuug!mjolner!newshost!eru
From: eru@tnvsu1.tele.nokia.fi (Erkki Ruohtula)
Newsgroups: comp.std.c
Subject: Order to pragma chaos (was Re: Another sizeof question)
Message-ID: <ERU.90Nov23145007@tnvsu1.tele.nokia.fi>
Date: 23 Nov 90 12:50:07 GMT
References: <13171@crdgw1.crd.ge.com> <12570055@hpclscu.HP.COM>
Sender: news@mjolner.tele.nokia.fi
Distribution: comp
Organization: Nokia Telecommunications
Lines: 34
In-reply-to: shankar@hpclscu.HP.COM's message of 20 Nov 90 01:43:03 GMT