C constant expressions proposals
Gabriel Dos Reis
gdr@integrable-solutions.net
Sat Aug 14 01:27:00 GMT 2004
"Joseph S. Myers" <jsm@polyomino.org.uk> writes:
| I have now prepared detailed semi-formal models of the interpretation of
| the C constant expression rules, and their extension to GNU C, along with
| ordinary English text descriptions of those extensions to constant
| expressions that are de facto present in GNU C (as part of the present
| "whatever the compiler of the day happens to fold to a constant is
| constant") and which seem likely to have been widely used or the
| preservation of which has been specifically requested in past discussions
| of constant expressions. Also included are some notes on the benefits
| naturally associated with implementation of well-defined constant
| expression rules, apart from better conformance.
|
| http://www.srcf.ucam.org/~jsm28/gcc/#const
|
| Feedback welcome on these models; the (newly revised and expanded)
| discussion of problems with constant expression rules in C99; the
| particular extensions that should be accepted in GNU C; and anything else
| about these proposals.
I would like to mention the following proposal
Generalized Constant Expressions
http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2003/n1521.pdf
that has been well received and encouraged at the Kona meeting of the
C++ standards meeting. I believe, in all modesty, that it is a
extension worth having in GNU C and GNU C++, pending final vote from
the C++ standards committee.
-- Gaby
More information about the Gcc
mailing list