Use -Wno-error to compile a file with Duff's device and document this as

a hack.
This commit is contained in:
simonb 2003-10-27 07:26:17 +00:00
parent b3a3d69b22
commit 075b65698a
3 changed files with 22 additions and 4 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: HACKS,v 1.12 2003/10/26 16:35:18 mycroft Exp $
# $NetBSD: HACKS,v 1.13 2003/10/27 07:26:17 simonb Exp $
#
# This file is intended to document workarounds for currently unsolved
# (mostly) compiler bugs.
@ -213,3 +213,16 @@ descr
newsyslog: config line 7: bad flags
solved when compiled with -fno-gcse-lm
kcah
hack gcc-pc532-duffs_device
cdate Mon Oct 27 07:23:05 UTC 2003
who simonb
port pc532
file sys/arch/pc532/conf/Makefile.pc532 : 1.71
file sys/arch/pc532/conf/files.pc532 : 1.52
descr
gcc incorrectly gives an "unreachable code at beginning of switch
statement" for a Duff's device construct in arch/pc532/dev/ncr.c.
There is now way to disable just this warning, so -Wno-error is
turned on for this file.
kcah

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.pc532,v 1.70 2002/07/09 12:55:47 simonb Exp $
# $NetBSD: Makefile.pc532,v 1.71 2003/10/27 07:26:17 simonb Exp $
# Makefile for NetBSD
#
@ -50,6 +50,9 @@ MD_SFILES= ${PC532}/pc532/locore.s
# egcs-1.1.2 bug fix; see doc/HACKS - egcs-pc532-ip6_mroute
CC_OPT1= ${NORMAL_C:C/-O[0-9]+/-O1/}
# gcc-3.3.2 bug fix; see doc/HACKS - gcc-pc532-duffs_device
CC_NOERROR= ${NORMAL_C:C/-Werror/-Wno-error/}
locore.o: ${PC532}/pc532/locore.s assym.h
${NORMAL_S}

View File

@ -1,4 +1,4 @@
# $NetBSD: files.pc532,v 1.51 2003/07/27 01:19:29 thorpej Exp $
# $NetBSD: files.pc532,v 1.52 2003/10/27 07:26:17 simonb Exp $
#
# new style config file for pc532 architecture
#
@ -36,7 +36,8 @@ include "dev/scsipi/files.scsipi"
device ncr: scsi, ncr5380sbc
attach ncr at mainbus
file arch/pc532/dev/ncr.c ncr needs-flag
# gcc-3.3.2 bug fix; see doc/HACKS - gcc-pc532-duffs_device
file arch/pc532/dev/ncr.c ncr needs-flag compile-with "${CC_NOERROR}"
#device aic: scsi
#attach aic at mainbus
#file arch/pc532/dev/aic.c aic needs-flag
@ -78,4 +79,5 @@ file arch/pc532/pc532/compat_13_machdep.c compat_13
# egcs-1.1.2 bug fix; see doc/HACKS - egcs-pc532-ip6_mroute
file netinet6/ip6_mroute.c compile-with "${CC_OPT1}"
include "arch/pc532/conf/majors.pc532"