Subject: port-i386/30533: bcmp re-definition in lib/libsa/stand.h causes make of sys/arch/i386/pxeboot to fail
To: None <port-i386-maintainer@netbsd.org, gnats-admin@netbsd.org,>
From: None <jclark@metricsystems.com>
List: netbsd-bugs
Date: 06/15/2005 18:21:00
>Number:         30533
>Category:       port-i386
>Synopsis:       bcmp re-definition in lib/libsa/stand.h causes make of sys/arch/i386/pxeboot to fail
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    port-i386-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 15 18:21:00 +0000 2005
>Originator:     John Clark
>Release:        CVS snapshots of June 13-15
>Organization:
Metric Systems, Inc.
>Environment:
linux cross build environment
>Description:
Monday I checked out the latest CVS and began the build world process.

Eventually the build died on compiling 'pxeboot/pxe.c'

The reason seems to be due to a change in 'sys/lib/libsa/stand.h'

In stand.h there are several 'rename' defines, such as:

#ifdef LIBSA_RENAME_PRINTF
...
#endif

And:

#ifdef LIBSA_USE_MEMSET
#define bzero(s, l)   memset(s,0,l)
#endif

However, between early May and June 13, the following define
has just been blythly inserted into stand.h.

#define bcmp(s1, s2, l )   memcmp(s1, s2, l)

Without any ifdef conditional statements.

This results in a bad macro invocation in 'pxeboot/pxe.c' which
has as one of it's 'arguments' a macro S_SIZE("..."). This macro
expands to place the string, and the following length (strlen(..)) into
the parameter list.

However, because of the redefinition of 'bcmp' in 'stand.h' the macro
expansion of the re-defined 'bcmp' fails with an argument number missmatch.

John Clark

>How-To-Repeat:

>Fix:
Remove or create a conditional #ifdef for the re-definition of bcmp
found in stand.h.