Pedro Izecksohn wrote: > --- Thomas Hruska wrote: > >> There would also have been warnings on the next line of code with the >> compiler complaining about a "signed to unsigned conversion" or >> something like that. That would have been the more useful clue to the >> OP that a "weird conversion" was happening behind the scenes. > > Yeah, gcc -Wconversion does not warn about it. > > Nice comment. > > May I report this to the gcc maintainers?
gcc is a very stable compiler and has been around for a really long time. I'm sure there is a way to get the warning level high enough to warn about sign conversions. You could ask them, but try to not present it as a bug - the compiler is the way it is for quite a few historical reasons. One more thing to try: Try compiling your code as C++ and see if there is a difference. C++ compilers tend to generate a lot more warnings as the language is, generally-speaking, more strict. -- Thomas Hruska CubicleSoft President Ph: 517-803-4197 *NEW* MyTaskFocus 1.1 Get on task. Stay on task. http://www.CubicleSoft.com/MyTaskFocus/