Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!ucbvax!bloom-beacon!mcgill-vision!mouse From: mouse@mcgill-vision.UUCP (der Mouse) Newsgroups: comp.lang.misc Subject: Re: C++ enhancements Message-ID: <1056@mcgill-vision.UUCP> Date: 17 Apr 88 08:18:11 GMT References: <2781@mmintl.UUCP> <2249424b:4311@snark.UUCP> <2789@mmintl.UUCP> <530@spectrix.UUCP> Organization: McGill University, Montreal Lines: 50 Keywords: pragma >>> OPTIMIZATION HINTS SHOULD BE PROPOSED AS OPTIONAL PRAGMAS, IF AT ALL >> I have trouble with pragmas. [...] The problem is that each vendor >> is allowed to define their own pragmas, with no guarantee that >> someone else won't use the same pragma for something entirely >> different. This is the price you pay for using pragmas. Each vendor must be free to define their own pragmas, for they may be doing something different from what anyone else is doing. >> If pragmas are going to be used, they should be as much part of the >> language standard as the syntax. A vendor may choose to follow or >> ignore whatever pragmas they choose to; but *if* a pragma is not >> ignored, it should be used as specified. The problem with this is that it requires the standards committee to think of everything that a programmer may conceivably want to tell an optimizer, without knowing anything about the optimizer. I have no confidence whatever in anyone's ability to guess what vendor X will want to do in the way of optimization tomorrow. The whole point of pragma is that it allows compilers an escape route to let them do things we haven't thought of. The moment you try to formalize what's allowed in a pragma and what isn't, you lose this benefit. > You can have it both ways, if the syntax of pragma is chosen > carefully. Allow statements of the two forms: > pragma > pragma specific > Where is a "standard optional extension" that is defined > by the language standard-setting body. This is not too unreasonable, though I would prefer to have two different keywords rather than overloading "pragma". > An additional benefit is that anyone who uses a non-standard pragma > is forced to be aware that they are doing something that is not > portable. As "pragma" is currently defined, this is true for anyone using a pragma at all. So this is a non-point. der Mouse uucp: mouse@mcgill-vision.uucp arpa: mouse@larry.mcrcim.mcgill.edu