Buggifying critical core modules
Posted Mar 19, 2008 16:47 UTC (Wed) by
jengelh (subscriber, #33263)
In reply to:
Buggifying critical core modules by quotemstr
Parent article:
Who maintains dpkg?
#include <stdio.h>
#define E(t) printf(#t " = %u\n", sizeof(t));
int main(void)
{
E(void *);
E(void far *);
E(void near *);
E(void (*)(void));
}
near pointers are always 2, and far are always 4. But it is interesting to see that untagged pointers vary in size, depending on the compiler model. Turbo C++ 1.x for DOS says:
/* Tiny and Small model */
void * = 2
void (*)(void) = 2
/* Medium model */
void * = 2
void (*)(void) = 4
/* Compact model */
void * = 4
void (*)(void) = 2
/* Large and Huge model */
void * = 4
void (*)(void) = 4
/* For your information about this compiler, in all models: */
int = 2
long = 4
nonfunctionpointertype * is always the same width as void *, though.
(
Log in to post comments)