[haiku-development] Non-standard headers in default compiler search path

  • From: Adrien Destugues <pulkomandy@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Tue, 14 Apr 2015 19:03:22 +0200

Hi,

I am working with the cdrecord developer to get it working on Haiku
again. We found that /system/develop/headers/compatibility/bsd is in the
compiler default include search path. This is a bit annoying, because
the purpose of this folder is to hold non-standard functions we copied
from the *BSD. This means the function names are not reserver and
possibly a standard C application could redefine them (and use the same
names for something completely different).

I can think of two solutions:

1) Remove this from the default include path, and let applications
needing it manually pass the required -I options to the compiler.

2) Protect all the extensions with a define (such as BSD_SOURCE) and
require applications to define that. This is what is done in glibc
(using features.h to control what is or is not included), so it would be
a more usual solution, possibly saving us some work in configure scripts
looking for these extensions. Leave the headers in the standard include
path as they would not define anything anymore without the feature
enabled.

3) Do nothing at all, and be nonstandard. In that case the efforts to
keep everything in separate headers and a separate lib (libbsd) seems a
bit strange to me.

I'm not sure which options to use. Thoughts?

--
Adrien.

Other related posts: