tech-pkg archive

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

Re: Latest samba4 changes & heimdal breakage



> Date: Tue, 9 Aug 2022 11:06:46 -0700
> From: Jason Thorpe <thorpej%me.com@localhost>
> 
> > On Aug 9, 2022, at 10:24 AM, Martin Husemann <martin%duskware.de@localhost> wrote:
> > 
> > On Tue, Aug 09, 2022 at 05:52:16PM +0100, David Brownlee wrote:
> >> ../../third_party/heimdal/lib/roken/bswap.c:40:1: error: expected
> >> declaration specifiers or '...' before '__builtin_constant_p'
> >> bswap64 (uint64_t val)
> >> ^
> > 
> > bswap64 is a define in our headers, you need to #undef it in that .c file
> > (probably trying to implement a lib function of that same name), or exclude
> > the file from the build for NetBSD (as we already provide it).
> 
> Why is #including <stdio.h> bringing bswap64 into the namespace?

Probably because the user either

(a) explicitly defined _NETBSD_SOURCE, or
(b) didn't define any feature macros like _POSIX_C_SOURCE=200809L, in
which case NetBSD behaves as if you defined _NETBSD_SOURCE by default.

If they did define _NETBSD_SOURCE, then it's simply wrong for them to
try to define their own bswap64 function because we've taken that.

If they didn't define any feature macros, they should define the
appropriate ones for the language/API they meant to write against.
Maybe it is enough to add

CFLAGS+=	-std=c99

or

CPPFLAGS+=	-D_POSIX_C_SOURCE=200809L

or something, if those are appropriate for the code base.


Home | Main Index | Thread Index | Old Index