[Bug libstdc++/23271] Members of ctype_base appear not to be integral constant expressions.

2010-02-15 Thread paolo dot carlini at oracle dot com


--- Comment #11 from paolo dot carlini at oracle dot com  2010-02-15 17:44 
---
Ah, thanks Dave!


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23271



[Bug libstdc++/23271] Members of ctype_base appear not to be integral constant expressions.

2010-02-15 Thread davek at gcc dot gnu dot org


--- Comment #10 from davek at gcc dot gnu dot org  2010-02-15 17:35 ---
(still here - only de-cc'd one of my two addresses)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23271



[Bug libstdc++/23271] Members of ctype_base appear not to be integral constant expressions.

2010-02-15 Thread davek at gcc dot gnu dot org


--- Comment #9 from davek at gcc dot gnu dot org  2010-02-15 17:32 ---
(In reply to comment #5)
> Is the print member really already overflowed?  It has a value of 0200 which 
> is
> 0x80: so if char is signed (it is on cygwin) then it's setting the sign bit,
> which should be OK I think.  

No, it isn't.  A signed char can contain values between 0x7f and -0x80. 
Assigning a value of +0x80 to it results in overflow.  You could assign
(char)0x80 to it and it would be ok, but 0x80 by itself isn't a constant that
will fit in a signed char, so it does need the cast (or to be expressed as the
negative equivalent.)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23271



[Bug libstdc++/23271] Members of ctype_base appear not to be integral constant expressions.

2010-02-15 Thread davek at gcc dot gnu dot org


--- Comment #8 from davek at gcc dot gnu dot org  2010-02-15 17:31 ---
Oops, that was slightly premature.  I meant to add that the error (from the
original testcase) doesn't happen with the 4.3.4 system compiler nor with 4.5.0
head, and that I'm afraid there aren't going to be any bugs fixed in 3.4.4, the
entire 3 series is long dead.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23271



[Bug libstdc++/23271] Members of ctype_base appear not to be integral constant expressions.

2010-02-15 Thread davek at gcc dot gnu dot org


--- Comment #7 from davek at gcc dot gnu dot org  2010-02-15 17:30 ---
(In reply to comment #3)
> Confirmed, this is either a cygwin/newlib bug or a libstdc++ bug:
> reduced testcase for the error:

Reduced reduced testcase:

static const char print = 0x97;


-- 

davek at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||davek at gcc dot gnu dot org
 Status|NEW |RESOLVED
 Resolution||WONTFIX


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23271



[Bug libstdc++/23271] Members of ctype_base appear not to be integral constant expressions.

2010-02-15 Thread paolo dot carlini at oracle dot com


--- Comment #6 from paolo dot carlini at oracle dot com  2010-02-15 15:53 
---
Dave, any hints about this cygwin issue?


-- 

paolo dot carlini at oracle dot com changed:

   What|Removed |Added

 CC||dave dot korn dot cygwin at
   ||gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23271



[Bug libstdc++/23271] Members of ctype_base appear not to be integral constant expressions.

2005-08-08 Thread john at johnmaddock dot co dot uk

--- Additional Comments From john at johnmaddock dot co dot uk  2005-08-08 
09:57 ---
Is the print member really already overflowed?  It has a value of 0200 which is
0x80: so if char is signed (it is on cygwin) then it's setting the sign bit,
which should be OK I think.  Although I admit I would have prefered the use of
an unsigned type as a bitmask.

Aha! Is this the cause? : the signed value is promoted to an int initially *with
sign extension*, and then when the compiler has all the values it desides that
the enum needs only one byte for storage, so it tries to fit all the values into
"signed char", and only then finds that the promoted value won't fit?  I'm just
making wild guesses here you understand!

Thanks, John Maddock.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23271


[Bug libstdc++/23271] Members of ctype_base appear not to be integral constant expressions.

2005-08-07 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-07 
18:03 ---
ppc-darwin have the definition of mask type as:
typedef unsigned long mask;

i686-pc-linux have:
typedef unsigned short mask;


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23271


[Bug libstdc++/23271] Members of ctype_base appear not to be integral constant expressions.

2005-08-07 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-07 
17:59 ---
Confirmed, this is either a cygwin/newlib bug or a libstdc++ bug:
reduced testcase for the error:
typedef char mask;
static const mask print = 020 | 01 | 02 | 04 | 0200;
enum char_class_type{
  char_class_print = print
};

the overflow is correct print was already overflowed.

-- 
   What|Removed |Added

 Status|WAITING |NEW
 Ever Confirmed||1
  GCC build triplet|i686-pc-cygwin  |
   GCC host triplet|i686-pc-cygwin  |
   Last reconfirmed|-00-00 00:00:00 |2005-08-07 17:59:22
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23271


[Bug libstdc++/23271] Members of ctype_base appear not to be integral constant expressions.

2005-08-07 Thread pinskia at gcc dot gnu dot org


-- 
   What|Removed |Added

 CC||pinskia at gcc dot gnu dot
   ||org
 Status|UNCONFIRMED |WAITING


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23271


[Bug libstdc++/23271] Members of ctype_base appear not to be integral constant expressions.

2005-08-07 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-07 
15:08 ---
Could you attach the preprocessed source?

You can get the preprocessed source via -save-temps, and it is named with .ii 
as the suffix.

-- 
   What|Removed |Added

  GCC build triplet|gcc version 3.4.4 (cygming  |i686-pc-cygwin
   |special) (gdc 0.12, using   |
   |dmd 0.125)  |
   GCC host triplet|gcc version 3.4.4 (cygming  |i686-pc-cygwin
   |special) (gdc 0.12, using   |
   |dmd 0.125)  |
 GCC target triplet|gcc version 3.4.4 (cygming  |i686-pc-cygwin
   |special) (gdc 0.12, using   |
   |dmd 0.125)  |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23271