This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: New testcase


On Tue, 14 Nov 2000, Richard Henderson wrote:

> > (b) it isn't one of the listed types of constant expressions in
> > initializers (but maybe 6.6p10 allows such extensions in initializers,
> > comp.std.c wasn't clear on this when I asked though the view was that the
> > listed types of integer constant expression couldn't be extended).
>
> Huh?  "Maybe"?
>
> # 10   An implementation may accept other forms of constant expressions.
>
> That's the entire paragraph.  How much less ambiguous could it be?

When I asked on comp.std.c:

James Kuyper <kuyper@wizard.net>:

	"Joseph S. Myers" wrote:
	...
	> The question here is what is permitted by 6.6p10, "An implementation
	> may accept other forms of constant expressions.".  Does this allow new
	> forms of integer constant expressions (not satisfying the description
	> in 6.6p6)?  Does this allow new forms of constant expressions in
	> initializers (none of the four forms enumerated in 6.6p7)? ...

	I don't think that the "other forms" allowed by p10 are meant to modify
	the preceding semantic descriptions, but to add to them. I think an
	implementation is not allowed to recognize additional integral constant
	expressions (p6), arithmetic constant expressions(p8), or pointer
	constant expressions (p9). I'm not sure whether the "other forms" are
	intended to be usable in initializers (p7).

	> ... And if the
	> new forms permitted do not meet the Semantics requirements, must they
	> nevertheless meet the Constraints?

	p10 is part of the semantics section. Therefore, it extends the allowed
	semantics. The Syntax (p1), Description (p2), and Constraints (p3-4)
	still apply.

Douglas A. Gwyn <gwyn@arl.army.mil>:

	James Kuyper wrote:
	> I don't think that the "other forms" allowed by p10 are meant to modify
	> the preceding semantic descriptions, but to add to them.

	That's right.

In the absence of any dissenting views on comp.std.c, I implemented the
testcases accordingly.

-- 
Joseph S. Myers
jsm28@cam.ac.uk


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]