cvs.delorie.com/djgpp/bugs/show.cgi | search |
The sizeof operator returns 4, for an unsigned. #include <stdio.h> main() { printf( "sizeof(unsigned) = %u\n", sizeof(unsigned) ); } output: sizeof(unsigned) = 4
it isn't a bug in p-mode the defualt integer size is long (4 bytes) instead of real modes default short (2) bytes. sizeof(unsigned short) = 2 sizeof(unsigned long) = 4 //default varible is 4 bytes sizeof(unsigned) = sizeof(unsigned long)
It's not protected-mode which does that! DJGPP makes 32-bit programs. Therefore, integers are four bytes long. (Protected-mode on the 286 micro-processor is 16 bits. So, "int"s are the same as "short int"s, there.)
webmaster | delorie software privacy |
Copyright © 2010 by DJ Delorie | Updated Jul 2010 |