Paweł Sikora wrote: >> On the other hand, if you are writing a portable library designed >> to be used with other people's programs, you might every well want >> the warning -- because you can't be sure that they're not going to >> pass "7" in as the value of "e", and you may want to be robust in >> the face of this *unspecified* behavior. > > sorry, i don't care about unspecified/undefined behavior triggered > by users glitches. it's not a problem of my library.
The point I was trying to make was that "unspecified" and "undefined" are actually very different. I wouldn't be too surprised if, in the future, G++ defined the behavior of the "e = (E) 7" case as storing the value in the underlying type. Then, might indeed rely on that. Obviously, you're free to make your own decisions, but, personally, I would certainly feel free to assume that no undefined behavior happened in the application -- but I wouldn't assume that no unspecified behavior occurred. -- Mark Mitchell CodeSourcery [EMAIL PROTECTED] (650) 331-3385 x713