From owner-freebsd-arch@FreeBSD.ORG Sun Jun 22 01:23:29 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3467337B401 for ; Sun, 22 Jun 2003 01:23:29 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 21FB343FCB for ; Sun, 22 Jun 2003 01:23:28 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id SAA22520; Sun, 22 Jun 2003 18:23:21 +1000 Date: Sun, 22 Jun 2003 18:23:20 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: David Schultz In-Reply-To: <20030622035258.GB60460@HAL9000.homeunix.com> Message-ID: <20030622180851.K55800@gamplex.bde.org> References: <20030622005124.GA59673@HAL9000.homeunix.com> <20030622035258.GB60460@HAL9000.homeunix.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: arch@freebsd.org Subject: Re: Per-source CFLAGS X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2003 08:23:29 -0000 On Sat, 21 Jun 2003, David Schultz wrote: > On Sun, Jun 22, 2003, Bruce Evans wrote: > > For this, you really want per-file WARNS, since among other reasons > > compiler-dependent flags shouldn't be put in individual Makefiles. > > ... > > Do you need to turn off all warnings or just ones for non-broken > > precedence and a few other non-broken things? gcc doesn't give > > In this case, we really do want to ignore all the warnings. This > is vendor code, written in a style that makes it easiest for the > author to maintain. But not necessarily easiest for us to maintain. We enable some warnings for lots of things under contrib although most things under contrib are not FreeBSD-warning clean. I realize that gdtoa is special since it is compiled as part of libc. > It so happens that -w is a de facto (if not > de jura) standard; it is supported by the GNU, Intel, and Sun C > compilers at least. It's not de-jure in POSIX (c99). > > > # SINGLE SUFFIX RULES > > > .c: > > > - ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.IMPSRC} > > > + ${CC} ${CFLAGS} ${CFLAGS_${.IMPSRC}} ${LDFLAGS} \ > > > + -o ${.TARGET} ${.IMPSRC} > > > ... > > > > Some rules are specified by POSIX, so they can't be changed. I don't > > see how ${CFLAGS} can be per-file directly, so the POSIX spec seems to > > be actively opposed to per-file CFLAGS. > > ??? You mean we can't add a variable that will normally expand to > nil? This seems like a compatible change, unless you're worried > about someone's makefile breaking because they defined > CFLAGS_foo.c to mean something else. >From POSIX.1-200x-draft7.txt: % 23836 Default Rules % 23837 The default rules for make shall achieve results that are the same as if the following were used. % ... % 23864 SINGLE SUFFIX RULES % 23865 .c: % 23866 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< This leaves little scope for modifying the default rules. Bruce