Bug 3081

Summary: Build fails on IRIX since memmem() is not declared
Product: Portable OpenSSH Reporter: mindrot
Component: MiscellaneousAssignee: Assigned to nobody <unassigned-bugs>
Status: CLOSED FIXED    
Severity: normal CC: dtucker
Priority: P5    
Version: 8.1p1   
Hardware: MIPS   
OS: IRIX   
Bug Depends on:    
Bug Blocks: 3079    
Attachments:
Description Flags
declare MEMMEM patch none

Description mindrot 2019-10-10 06:33:39 AEDT
Created attachment 3334 [details]
declare MEMMEM patch

Compilation of sshbuf-misc.c, fails on IRIX:


cc-1196 c99: WARNING File = sshbuf-misc.c, Line = 225
  The indicated function is declared implicitly.

        if ((p = memmem(sshbuf_ptr(b) + start_offset,
                 ^

cc-1515 c99: ERROR File = sshbuf-misc.c, Line = 225
  A value of type "int" cannot be assigned to an entity of type "void *".

        if ((p = memmem(sshbuf_ptr(b) + start_offset,
               ^

1 error detected in the compilation of "sshbuf-misc.c".

I would suspect that there's a typo in openbsd-compat.h in that #ifdef has been used instead of #ifndef for HAVE_MEMMEM. With the trivial patch below, compilation succeeds for me on IRIX 6.5.30.
Comment 1 Darren Tucker 2019-10-10 09:47:24 AEDT
Done, thanks.  It'll be in the next release.
Comment 2 Damien Miller 2021-04-23 14:56:57 AEST
closing resolved bugs as of 8.6p1 release