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, Nov 14, 2000 at 03:16:07PM +0000, Joseph S. Myers wrote:
> (a) The pointers needn't in ISO C point to within the same object,
> pointer subtraction is only (6.5.6p9 in C99) defined if they do;

But this is gcc, and they *will* be the same object.
(Unless -fwritable-strings, but that's not relevant here.)

> (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?

In any case, the glibc usage itself is not in an initializer, but
writing the *test case* as an initializer lets us see that there
has been a regression in constant folding.

> 	* gcc.dg/c90-const-expr-2.c, gcc.dg/c99-const-expr-2.c: Add more
> 	tests.

I admit that this concept of Null Pointer Constant is not
well-formed in my brain.  However, these additions don't
seem any weirder than what was already there, so "ok".


r~

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