I have several copies of, let's say, stddef.h on my system, one is in the path /usr/include/linux/stddef.h, and looks like this:
#ifndef _LINUX_STDDEF_H #define _LINUX_STDDEF_H #undef NULL #if defined(__cplusplus) #define NULL 0 #else #define NULL ((void *)0) #endif #endif Another one is in the path /usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/include/, and that is the one which is used when I say #include <stddef.h>. That one's contents are a lot different from the first one, contains the definitions of ptrdiff_t, size_t etc.
My question is: As far as I know, the C/C++ standards require that the definition of size_t should be placed in stddef.h, however the first one doesn't follow that. That one clearly isn't the one mentioned by the C/C++ standards. If that file is there on for some other purpose, why are both of these files named as stddef.h, wouldn't it be safer/more clear if they had different names?
apt-fileyields:linux-libc-dev: /usr/include/linux/stddef.handgcc-4.5: /usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/include/stddef.h/usr/include/linux/stddef.himplies it's the standard header. There is nostddef.hunder/usr/includein my copy of Linux (Slackware64 13)./usr/include/linuxare kernel headers. the glibc headers are placed in separate directories for each version of glibc installed on the system.x.hdoes not create ambiguities?