pardo@uw-june.UUCP (David Keppel) (12/18/87)
Instead of worrying about keyword additons to the language, register, noregister, reducible, irreducible, etc., how about adding a "pragma" which looks like a procedure call. Making the number of arguments fixed would allow older compilers to #define them away. This seems more sensible to me. Am I overlooking some obvious problem? ;-D on (My bug has a compiler in it!) Pardo
gwyn@brl-smoke.ARPA (Doug Gwyn ) (12/19/87)
In article <3855@uw-june.UUCP> pardo@uw-june.UUCP (David Keppel) writes:
-Instead of worrying about keyword additons to the language, register,
-noregister, reducible, irreducible, etc., how about adding a "pragma"
-which looks like a procedure call. Making the number of arguments
-fixed would allow older compilers to #define them away.
Apart from the X3J11 committee's natural reluctance to standardize
any pragmas, I don't understand just what it is that you are proposing.
pardo@uw-june.UUCP (David Keppel) (12/20/87)
>In article <3855@uw-june.UUCP> pardo@uw-june.UUCP (David Keppel) writes: >>Instead of worrying about keyword additons to the language, register, >>noregister, reducible, irreducible, etc., how about adding a "pragma" >>which looks like a procedure call. Making the number of arguments >>fixed would allow older compilers to #define them away. > >Apart from the X3J11 committee's natural reluctance to standardize >any pragmas, I don't understand just what it is that you are proposing. People posted several very good (I thought) ideas for possible optimizations beyond "nolaias". I think the ideas (such as noailias) are good and I would (will) use them. I don't think, however, that any of these optimizing hints should be reserved keywords in the language. By adding even a small pragma mechanism to the language it would be possible to have these optimizing suggestions handed to the compiler without modifying C (beyond the addition of a pragma mechanism). By making the pragmas some form other than a comment, we don't have to worry about CPP stripping out comments. By using only a small pragma mechanism older compilers can compile new code without needing to know explicitly what all the pragmas are: #define pragma(command) /* substitute nothing */ and by having a pragma mechanism we can all have the optimizations our compiler-writers provide (e.g., reducible) without trying to decide whether these things are really so important that we must modify the language. I think that most people will agree to a pragma mechanism. Even if they think they won't be using one optimization, they probably agree that they will be using another one. Pragmas both make hints possible and avoid cluttering the language. It is important, however, for a body such as ANSI to lay down some initial ground-rules for pragmas so that everybody agrees on how they will work on compilers that do implement them. Once again, if I'm missing something, don't hesitate to call... ;-D on (Merry Cmas) Pardo