Subject: Re: pkgsrc NetBSD 3.99.3/i386 bulk build results 2005-04-23
To: Thomas Klausner <wiz@NetBSD.org>
From: Greg Troxel <gdt@ir.bbn.com>
List: tech-pkg
Date: 04/25/2005 11:35:34
  > graphics/gimp-ufraw                gdt@ir.bbn.com

   dcraw.c:187: error: conflicting types for `memmem'
   /usr/include/string.h:83: error: previous declaration of `memmem'

memmem has appeared in NetBSD 3 from glibc, and the dcraw replacement
code (ifndef __GLIBC__) uses char * rather than const void *.

Arguably the right thing to do is from ufraw to use autoconf or some
such, but it doesn't.

Given the lack of autoconf, what's the best way to fix this?
Essentially I need to change the code to drop the replacement
definition on systems that have memmem but do not define __GLIBC__.

not really relevant, but:
I note that strstr takes a const char * first argument, and returns a
non-const char * pointer into it.  This seems broken, but the man page
claims it is C90-compliant.  memmem takes const void * but returns
void *, which seems similarly broken, since it provides an unchecked
way to drop const from a pointer.