Re: strnstr errors in tests while on NetBSD

Richard Frith-Macdonald <[email protected]>
Newsgroups gmane.comp.lib.gnustep.devel
Message-ID <[email protected]>

> On 22 Jan 2021, at 07:26, Riccardo Mottola <[email protected]> wrote:
> 
> Hi,
> 
> while building tests on NetBSD/sparc I saw that many tests failed for
> this reason:
> 
> build.m:7:1: error: conflicting types for 'strnstr'
>  strnstr(const uint8_t *buf, unsigned len, const uint8_t *str)
>  ^
> In file included from
> /home/multix/gnustep-svc/libs-base/Headers/GNUstepBase/GSConfig.h:430:0,
>                  from
> /home/multix/gnustep-svc/libs-base/Headers/GNUstepBase/GSVersionMacros.h:224,
>                  from
> /home/multix/gnustep-svc/libs-base/Headers/Foundation/Foundation.h:30,
>                  from build.m:2:
> /usr/include/string.h:107:7: note: previous declaration of 'strnstr' was
> here
>  char *strnstr(const char *, const char *, size_t);
> 
> 
> they don't even build.

I don't know how that could fail 'many tests', because the only place in the entire sourcecode that uses strnstr is the GSMime tests.
For that file, I simply changed the local function name to avoid conflict with the BSD function.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.