__ERROR__XX__NEVER_USE_STRCASECMP__ (3.0.1 on SGI Irix 6.5)

Jelmer Vernooij jelmer at vernstok.nl
Thu Jan 8 19:44:28 GMT 2004


Christian Griebel wrote:

>Dear Samba fans,
>
>trying to compile samba-3.0.1 on SGI Irix 6.5 with the MIPSPro 7.2 compiler
>gives
>
>Compiling nsswitch/wins.c with -KPIC
>cc-1020 cc: ERROR File = nsswitch/wins.c, Line = 197
>  The identifier "__ERROR__XX__NEVER_USE_STRCASECMP__" is undefined.
>
>        if (strcasecmp(map,"hosts.byaddr") == 0) {
>            ^
>
>cc-1018 cc: ERROR File = nsswitch/wins.c, Line = 197
>  An unmatched left parentheses "(" appears in an expression.
>
>        if (strcasecmp(map,"hosts.byaddr") == 0) {
>            ^
>
>cc-1018 cc: ERROR File = nsswitch/wins.c, Line = 225
>  An unmatched left parentheses "(" appears in an expression.
>
>        } else if (strcasecmp(map,"hosts.byname") == 0) {
>                   ^
>whereas 3.0.0 compiled this without problems. Digging into it, I've found
>include/safe_string.h being the place where the
>__ERROR__XX__NEVER_USE_STRCASECMP__ gets defined. Few lines are added since
>3.0.0's safe_string.h:
>
>diff samba-3.0.*/source/include/safe_string.h
>49a50,63
>  
>
>>/*
>> * strcasecmp/strncasecmp aren't an error, but it means you're not thinking about
>> * multibyte. Don't use them. JRA.
>> */
>>#ifdef strcasecmp
>>#undef strcasecmp
>>#endif
>>#define strcasecmp __ERROR__XX__NEVER_USE_STRCASECMP__;
>>
>>#ifdef strncasecmp
>>#undef strncasecmp
>>#endif
>>#define strncasecmp __ERROR__XX__NEVER_USE_STRCASECMP__;
>>    
>>
>
>what seems to cause the MIPSPro compiler to bail out.
>Other code above and below these new lines contains the same style of
>redefinitions for "dangerous" functions, but this works as expected.
>Since I'm an administrator and not a developer, I'm out of luck here. The most
>recent binary for Irix is as well not a 3.0.1 so I think this may directly be of
>interest to the Irix port's team/person.
>Can somebody explain how to work around or how to fix the compiling error?
>  
>
strcasecmp should be replaced with StrCaseCmp at all places in the 
source.. I'll get it fixed in CVS..

__ERROR_XX_NEVER_USE_STRCASECMP__ was introduced some time ago to make 
sure strcasecmp was never used
and it looks like all the IRIX-specific code hasn't yet been fixed.

Jelmer


More information about the samba-technical mailing list