From edwin@mavetju.org  Wed Feb  5 03:17:45 2003
Return-Path: <edwin@mavetju.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 3751937B401
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  5 Feb 2003 03:17:45 -0800 (PST)
Received: from topaz.mdcc.cx (topaz.mdcc.cx [212.204.230.141])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 7277B43FA7
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  5 Feb 2003 03:17:44 -0800 (PST)
	(envelope-from edwin@mavetju.org)
Received: from k7.mavetju (topaz.mdcc.cx [212.204.230.141])
	by topaz.mdcc.cx (Postfix) with ESMTP id 0BA2D2B845
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  5 Feb 2003 12:17:37 +0100 (CET)
Received: by k7.mavetju (Postfix, from userid 1001)
	id B748D6A712B; Wed,  5 Feb 2003 22:17:34 +1100 (EST)
Message-Id: <20030205111734.B748D6A712B@k7.mavetju>
Date: Wed,  5 Feb 2003 22:17:34 +1100 (EST)
From: Edwin Groothuis <edwin@mavetju.org>
Reply-To: Edwin Groothuis <edwin@mavetju.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: gcc 3.2.1 / strcasecmp() weirdness
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         47949
>Category:       bin
>Synopsis:       gcc 3.2.1 / strcasecmp() weirdness
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Feb 05 03:20:14 PST 2003
>Closed-Date:    Thu Feb 06 03:26:03 PST 2003
>Last-Modified:  Thu Feb 06 03:26:03 PST 2003
>Originator:     Edwin Groothuis
>Release:        FreeBSD 4.5-RELEASE i386
>Organization:
>Environment:
FreeBSD ref5.freebsd.org 5.0-CURRENT FreeBSD 5.0-CURRENT #24: Sat Jan  4 12:11:02 PST 2003     peter@ref5.freebsd.org:/usr/src/sys/i386/compile/REF5  i386

>Description:

I'm trying to compile security/clamav (ports/45686)
It fails with: 
zziplib/zzip-file.c: In function `zzip_file_open':
zziplib/zzip-file.c:116: `strcasecmp' undeclared (first use in this function)

116:	cmp = (o_mode & ZZIP_CASEINSENSITIVE)? strcasecmp: strcmp;


I add this line before line 116:
	if (strcasecmp("12","11")) printf("");

And it compiles without a problem.

Why oh why?

>How-To-Repeat:

Install the shar in ports/45686 and compile it on ref5.freebsd.org
(or any other -current machine probably)

It compiles fine on a 4.7 machine.
>Fix:
>Release-Note:
>Audit-Trail:

From: David Malone <dwmalone@maths.tcd.ie>
To: Edwin Groothuis <edwin@mavetju.org>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: bin/47949: gcc 3.2.1 / strcasecmp() weirdness
Date: Wed, 5 Feb 2003 12:06:05 +0000

 On Wed, Feb 05, 2003 at 10:17:34PM +1100, Edwin Groothuis wrote:
 > I add this line before line 116:
 > 	if (strcasecmp("12","11")) printf("");
 > 
 > And it compiles without a problem.
 > 
 > Why oh why?
 
 I suspect you're missing a "#include <string.h>" in the file. I
 suspect that using an unprototyped function may have the side effect
 of creating a implicit declaration of it. You probably don't get
 the same problem with strcmp 'cos it is used elsewhere in the file.
 
 	David.

From: Garrett Wollman <wollman@lcs.mit.edu>
To: Edwin Groothuis <edwin@mavetju.org>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: bin/47949: gcc 3.2.1 / strcasecmp() weirdness
Date: Wed, 5 Feb 2003 12:29:55 -0500 (EST)

 <<On Wed,  5 Feb 2003 22:17:34 +1100 (EST), Edwin Groothuis <edwin@mavetju.org> said:
 
 > I'm trying to compile security/clamav (ports/45686)
 > It fails with: 
 > zziplib/zzip-file.c: In function `zzip_file_open':
 > zziplib/zzip-file.c:116: `strcasecmp' undeclared (first use in this function)
 
 > 116:	cmp = (o_mode & ZZIP_CASEINSENSITIVE)? strcasecmp: strcmp;
 
 Which tells me that <strings.h> is not included -- a bug that I also
 ran into when I tried to compile this program.  I'm told by the author
 that it is fixed in the latest development sources.  (It's not as
 simple as just adding `#include <strings.h>', because the program
 comes with its own header also called "strings.h", and passes
 -I flags to the compiler that make it impossible to see the system
 version.)
 
 > I add this line before line 116:
 > 	if (strcasecmp("12","11")) printf("");
 
 > And it compiles without a problem.
 
 You have now implicitly declared the function, so the compiler now
 has a declaration in scope when compiling line 116.
 
 -GAWollman
 
State-Changed-From-To: open->closed 
State-Changed-By: edwin 
State-Changed-When: Thu Feb 6 03:18:58 PST 2003 
State-Changed-Why:  
Seems just an unfortunat problem with the source itself which didn't 
include the right strings.h. 

thanks! 


http://www.freebsd.org/cgi/query-pr.cgi?pr=47949 
>Unformatted:
