lkundrak / dev86

C compiler, assembler and linker environment for the production of 8086 executables
http://v3.sk/~lkundrak/dev86/
GNU General Public License v2.0
153 stars 44 forks source link

size_t should be an unsigned type #12

Closed clausecker closed 7 years ago

clausecker commented 8 years ago

In your current libc, size_t is a typedef for int. As per ISO 9899, it should be an unsigned type.

jbruchon commented 8 years ago

Fixed in https://github.com/jbruchon/dev86/commit/74753fa024ef5fec0261702d6d18a3773c44b62e

clausecker commented 8 years ago

Please also make sure that sizeof returns an unsigned.

jbruchon commented 8 years ago
dev86 $ grep -n sizeof bcc/*.c
...snip...
bcc/express.c:14:PRIVATE unsigned insizeof;     /* nest level for getsizeof */

Honestly, I'm not sure where in the spaghetti mess of bcc they hide it, but everywhere I see something related to sizeof I see unsigned beside it.