"Such trivialities are not specific to Haiku, there is plenty of documentation elsewhere on #include and command line flags to GCC" If the BSD headers are ignored otherwise, I guess that means when FreeBSD wifi drivers are configured, an -I flag will be necessary. OK, makes sense I suppose. On Fri, Aug 29, 2014 at 11:18 PM, James Leone <linuxcpa@xxxxxxxxx> wrote: > "Based on the order of include directory listing on the command line and > whether there was a bsd/ in the include directive." > > So because the output from gcc -v has: > .../posix > .../bsd > > the 9 BSD headers will always be ignored? > > > On Fri, Aug 29, 2014 at 11:11 PM, James Leone <linuxcpa@xxxxxxxxx> wrote: > >> gcc -v shows the following relevant directories as being root to include >> statements: >> >> /boot/system/develop/headers/posix >> /boot/system/develop/headers/bsd >> (Among several others) >> >> So when source code has "#include <stdio.h>" in it, when the source code >> compiles the compiler will look in both directories for stdio.h. >> Similarly, if the #include statement has #include <sys/wait.h> the >> compiler will look in both /boot/system/develop/headers/posix/sys and >> /boot/system/develop/headers/bsd/sys for wait.h. >> >> We have the following files in both the >> /boot/system/develop/headers/posix and /boot/system/develop/headers/bsd >> directories: >> >> errno.h >> time.h >> stdio.h >> stlib.h >> string.h >> >> We have the following files in both the >> /boot/system/develop/headers/posix/sys and >> /boot/system/develop/headers/bsd/sys directories: >> wait.h >> cdefs.h >> param.h >> >> My question was how does the compiler know what to pick, because, from >> what I understand, they are duplicated. >> I wasn't asking about the purpose of the BSD headers. >> If this is an issue - certainly I should mention it - and perhaps get >> the question resolved for others that are interested to know how the >> compiler chooses the correct header. >> >> The zlib header in our system is missing lines 1350-1352 when compared to >> the same header present in Linux, with the same authors: >> Jean-loup Gailly and Mark Adler (zlib.h) >> >> The missing(?) code is as follows: >> >> 1349 ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char >> *format, ...)) >> 1350 #ifdef __GNUC__ >> 1351 __attribute__((__format__(__printf__,2,3))) >> 1352 #endif >> 1353 ; >> >> This may have been removed for a good reason. I don't know. But if its a >> bug I should mention it. >> The only reason I looked at it was because I had a compilation error >> arise for the program Archangel. >> I wanted to see if there was a difference given that it is not a header >> written by Haiku. >> >> >> >> >> On Fri, Aug 29, 2014 at 11:38 AM, Augustin Cavalier < >> waddlesplash@xxxxxxxxx> wrote: >> >>> On Aug 29, 2014 11:48 AM, "James Leone" <linuxcpa@xxxxxxxxx> wrote: >>> > >>> > I noticed that some code that includes headers i.e. <*.h> wants to >>> read the /boot/system/develop and .../develop/posix and .../develop/bsd >>> directorories. Similarly, <sys/*.h> would read from both of these: >>> ....posix/sys and .....bsd/sys. >>> > >>> > We have 9 duplicates amongst theze directories. >>> > >>> > How does the compiler know which one to pick? >>> >>> Based on the order of include directory listing on the command line and >>> whether there was a bsd/ in the include directive. And these are nor >>> duplicates, they are for the freebsd WiFi compat layer. >>> >>> Such trivialities are not specific to Haiku, there is plenty of >>> documentation elsewhere on #include and command line flags to GCC. >>> >>> > P.s. our zlib.h is misding 3 lines of code compared to Linux' same. >>> Same author and pub date. >>> >>> Which are? >>> -Augustin >>> >> >> >