delorie.com/djgpp/bugs/show.cgi | search |
When I write c++ code like this, cout << sizeof(int) << sizeof(long); it reports that both integers and long int's take up 4 bytes. I am new to DJGPP, and I am wondering if it is suppose to be like this. It would be pointless if it were, since it would be the exact same type and you couldn't use a 16-bit int to automatically wrap it on overflow modulo 0xFF. MDK187
Is this really a bug? in protected mode 32 bit environment, an integer is 32 bits! (integer length depends on the machine) long ints are always 4 bytes! so... where is the problem? :)
This is not, nor has it ever been a 'bug' or even a 'problem'. Who said that 'int' and 'long int' should not be of equal size (and, thus, range)? Hint: if you want 16bit integers, use 'short int'. For a cleanly written, portable program, none of these issues should ever make a difference. I'm closing this issue.
webmaster | delorie software privacy |
Copyright © 2010 by DJ Delorie | Updated Jul 2010 |