[PATCH] PR c/14088

Joseph S. Myers jsm@polyomino.org.uk
Tue Feb 10 23:55:00 GMT 2004


On Wed, 11 Feb 2004, [iso-8859-1] Danny Smith wrote:

> Will this do?
> 
> /* PR c/14088
>    Test that uppercase and lowercase 'x' in hexfloat prefix
>    yield same real nuber.  */
> 
> * { dg-options "-std=iso9899:1999" } */
> 
> #define x1    (double)0x1p1
> #define x2   (double)0X1p1
> 
> char tst1 [(x1 == 2.0) ?  1 : -1];
> char tst2 [(x1 == x2) ?  1 : -1];

These aren't actually integer constant expressions (although they are
wrongly accepted as such at present) so defining x1 as (int)0x1p1 etc.  
(and comparing then with integer 2) would be better (and I think would
still detect this bug).

-- 
Joseph S. Myers
jsm@polyomino.org.uk



More information about the Gcc-patches mailing list