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]
Other format: [Raw text]

Re: [PATCH] PR c/14088


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


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