Different #ifdef used for memmem() declaration and definition. https://github.com/openssh/openssh-portable/blob/d6cc76176216fe3fac16cd20d148d75cb9c50876/openbsd-compat/openbsd-compat.h#L76 #if defined(HAVE_DECL_MEMMEM) && HAVE_DECL_MEMMEM == 0 void *memmem(const void *, size_t, const void *, size_t); #endif https://github.com/openssh/openssh-portable/blob/d6cc76176216fe3fac16cd20d148d75cb9c50876/openbsd-compat/memmem.c#L32 still uses #ifndef HAVE_MEMMEM.
Nope that's deliberate. HAVE_MEMMEM means you have the function, HAVE_DECL_MEMMEM means you have the function declaration. Over in bug#3102 we found a system that had the function but not the declaration. At least I think that's what was going on. I don't have access to the affected system but the HAVE_DECL_MEMMEM change did apparently fix it.
Interesting. If there is a system that doesn't have a declaration but has a definition then the issue is specific to that environment? Is it expected behavior? I guess No?
(In reply to balu from comment #2) > Interesting. If there is a system that doesn't have a declaration > but has a definition then the issue is specific to that environment? Like I said I think that's what was going on, but it's not 100% clear (the reporter said they did not have HAVE_MEMMEM, but in that case I would have expected the old "#ifndef HAVE_MEMMEM" to have worked). > Is it expected behavior? I guess No? Well I'd expect a platform to have both declaration and implementation but in the case of having implementation only I'd expect it to cause problems in LP64 platforms. There's a lot of weirdness out there.
closing resolved bugs as of 8.6p1 release