Mail Archives: djgpp/2000/10/17/10:27:22
Hi there everyone.. I just recently shifted from using Borland Turbo C++
to DJGPP and I besides the funny error messages that GCC gives, its been
quite a good experience...
most recently, I noticed that one of my old functions that I wrote using
TC has been acting wierdly.. I did some further investigate a bit futher
and found that this line of code executes differently in TC and GCC
main()
{
unsigned int data=1;
data=0-data;
printf("%u",data);
return;
}
on TC, I will get the desire result of 65535 as the 16-bit unsigned int
will overflow into and display this value... but apparently, under
DJGPP/GCC, an unsigned int is 32-bit and I get the unwanted value of
4294967295 ...
is there a good work around to allow the code to work in both compilers?
thanks a lot guys!
- Raw text -