This is the mail archive of the gcc@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]

Do C++ signed types have modulo semantics?





According to the (very) long discussion on VRP, signed char/short/int/etc
do not have modulo semantic, they have an undefined behavior on overflow.
However in <limits> defines numeric_limits<signed type>::is_modulo = true.

1. Is that a bug in <limits>, a bug in the standard, or is just C++
different
   than C in this respect?
2. Maybe because overflow is undefined then is_modulo maybe
   considered "unspecified". I don't like this option, because it does not
help
   generic programming.
3. Do I understand what is_modulo stands for?
4. What should be done (libstdc++ PR, C++ PR, DR, other)?

I have seen this in gcc-4.0-20050602, and gcc-3.4.3



  Michael


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