Subject: port-amiga/2115: /src/sys/arch/amiga/dev/ite.c has static declaration of strncmp
To: None <gnats-bugs@NetBSD.ORG>
From: Thorsten Frueauf <frueauf@ira.uka.de>
List: netbsd-bugs
Date: 02/23/1996 17:29:56
>Number:         2115
>Category:       port-amiga
>Synopsis:       /src/sys/arch/amiga/dev/ite.c has static declaration of strncmp
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 23 12:05:02 1996
>Last-Modified:
>Originator:     Thorsten Frueauf
>Organization:
private
>Release:        <NetBSD-current source date> NetBSD current 22.02.1996
>Environment:
	
System: NetBSD di_frueauf 1.1A NetBSD 1.1A (CYBERDYNE) #0: Thu Feb 15 22:48:00 GMT 1996 milano@di_frueauf:/home/milano/source/netbsd-src/sys/arch/amiga/compile/CYBERDYNE amiga


>Description:
	
/src/sys/arch/amiga/dev/ite.c has static declaration of strncmp which
breaks the compilation of a kernel on Amiga.

>How-To-Repeat:
	

Try to compile a kernel on Amiga and watch:

cc  -O2 -Werror -mc68020 -msoft-float -I. -I../../../../arch -I../../../.. -DTIM
EZONE="0" -DDST="1" -DNMBCLUSTERS="0x400" -DM68030 -DM68020 -DFPCOPROC -DSWAPPAG
ER -DVNODEPAGER -DDEVPAGER -DINET -DIPFILTER -DGATEWAY -DDIRECTED_BROADCAST -DMR
OUTING -DNFSSERVER -DNFSCLIENT -DFFS -DMFS -DPROCFS -DKERNFS -DFDESC -DNULLFS -D
FIFO -DADOSFS -DCD9660 -DUNION -DUMAPFS -DCOMPAT_10 -DCOMPAT_09 -DCOMPAT_43 -DCO
MPAT_SUNOS -DTCP_COMPAT_42 -DCOMPAT_NOMID -DSYSVSHM -DSYSVMSG -DSYSVSEM -DGENERI
C -DLKM -DKTRACE -DDIAGNOSTIC -DNKMEMCLUSTERS=256 -DPANICWAIT -DDEBUG -DDDB -DKB
DRESET -DMACHINE_NONCONTIG -DCL5426CONSOLE -DGRF_CL5426 -D_KERNEL -Dmc68020 -Dam
iga  -c ../../../../arch/amiga/dev/ite.c
cc1: warnings being treated as errors
../../../../arch/amiga/dev/ite.c:1332: warning: static declaration for `strncmp'
 follows non-static
../../../../arch/amiga/dev/ite.c: In function `strncmp':
../../../../arch/amiga/dev/ite.c:1334: argument `l' doesn't match prototype
../../../../lib/libkern/libkern.h:119: prototype declaration
*** Error code 1

>Fix:
	
Apply the following patch:

*** ite.c-orig  Tue Dec 12 15:44:13 1995
--- ite.c-new   Fri Feb 23 17:29:00 1996
***************
*** 1327,1343 ****
    return n;   /* don't "n ? n : 1" here, <CSI>0m != <CSI>1m ! */
  }
  
- inline static int
- strncmp (a, b, l)
-     const char *a, *b;
-     int l;
- {
-   for (;l--; a++, b++)
-     if (*a != *b)
-       return *a - *b;
-   return 0;
- }
- 
  void
  ite_putstr(s, len, dev)
        const char *s;
--- 1327,1332 ----
>Audit-Trail:
>Unformatted:
/src/sys/arch/amiga/dev/ite.c has static declaration of strncmp