From owner-svn-src-all@FreeBSD.ORG Fri Feb 24 19:31:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D674106566B; Fri, 24 Feb 2012 19:31:32 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id D65EA8FC18; Fri, 24 Feb 2012 19:31:31 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q1OJVS9w030372 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 25 Feb 2012 06:31:29 +1100 Date: Sat, 25 Feb 2012 06:31:28 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alexander Best In-Reply-To: <20120224112224.GA13109@freebsd.org> Message-ID: <20120225061506.C2626@besplex.bde.org> References: <201202232134.q1NLYEq5024067@svn.freebsd.org> <20120224093807.GA88853@freebsd.org> <4F476FEA.1090004@FreeBSD.org> <20120224112224.GA13109@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dimitry Andric Subject: Re: svn commit: r232074 - head/sys/cam/ctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Feb 2012 19:31:32 -0000 On Fri, 24 Feb 2012, Alexander Best wrote: > On Fri Feb 24 12, Dimitry Andric wrote: >> On 2012-02-24 10:38, Alexander Best wrote: >>> which will turn all -Wformat-invalid-specifier and -Wformat-extra-args errors >>> into warnings (because clang tot doesn't support -fformat-extensions)? >> >> It would be better to push our format extensions upstream, I think. >> Though the option should probably be renamed to something else, e.g. >> -ffreebsd-extensions, or such. It is only for format extensions. The idea is that a C compiler that supports warning about unsupported printf formats must warn about uses of format extensions (no matter whose they are) unless instructed not to do so. It seems excessive to have separate flags -fbsd-format-extensions -ffreebsd-format-extensions -fotherbsd-format-extensions -fgnu-format-extensions -flinux-format-extensions ..., so I used a single flag. If -fbsd-format-extensions existed, then it would have only %b as an extension. Anyway, clang already supports -fformat-extensions. The following compiles with this, but fails messily without it: % #include % % void % foo(void) % { % printf("0x%b\n", 1, "\1foo"); % } gcc (FreeBSD-gcc) complains about %#b, but clang doesn't. I don't know if %#b is valid, but it should be. > i'm still confused regarding the actual politics regarding this change. > everytime this comes up i get a different answer. the last one was that since > the special printf format is only used for kernel code, the -fformat-extensions > code within clang base shouldn't be pushed upstream. Is it only the FreeBSD version of clang that has it? Does FreeBSD has any other significant local changes? The flag should be push upstream, but there are likely to always be OS-specific details. For example, if %#b is indeed invalid and someone fixes the kernel to support it, you don't want to have to wait for the upstream sources to be synchronized before using %#b. Bruce