Re: [PATCH] compat: fixes for header handling with OpenBSD / NetBSD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2025-06-02 2:06 p.m., Collin Funk wrote:
Hi Brad,

You wrote:

Handle OpenBSD and NetBSD as FreeBSD / DragonFly are. OpenBSD would
need _XOPEN_SOURCE to be set to 700. Its simpler to just not set
_XOPEN_SOURCE.

     CC strbuf.o
strbuf.c:645:6: warning: call to undeclared function 'getdelim'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
         r = getdelim(&sb->buf, &sb->alloc, term, fp);
             ^
1 warning generated.

Signed-off-by: Brad Smith <brad@xxxxxxxxxxxx>
---
  compat/posix.h | 11 +++++------
  1 file changed, 5 insertions(+), 6 deletions(-)
I noticed this as well when testing your other fixes.

Just one question about this chunk:

  #define _DEFAULT_SOURCE 1
-#define _NETBSD_SOURCE 1
Why remove this definition? I think it might be useful on some older
systems and seems harmless otherwise.

_XOPEN_SOURCE restricts the build environment. _NETBSD_SOURCE is added to counteract _XOPEN_SOURCE. Not setting it in the first place provides everything by default.

I was removing it as it should no longer be necessary.

But as said, it is harmless. I can leave it in if desired.

Other than that, I tested on OpenBSD 7.6 and NetBSD 10.0 and this patch
fixes the missing declarations. So:

Reviewed-by: Collin Funk <collin.funk1@xxxxxxxxx>

Collin





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux