From owner-svn-src-all@FreeBSD.ORG Fri Mar 27 14:31:03 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1626531E for ; Fri, 27 Mar 2015 14:31:03 +0000 (UTC) Received: from nm26-vm0.bullet.mail.bf1.yahoo.com (nm26-vm0.bullet.mail.bf1.yahoo.com [98.139.213.74]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C03F2CD2 for ; Fri, 27 Mar 2015 14:31:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1427466656; bh=XSPFV9xIUYSuHt/+KhCwQ2Pcc7YtfujJAdm3JfrpWVI=; h=Date:From:To:CC:Subject:References:In-Reply-To:From:Subject; b=jD8ACa0+G8+RI2xjoCVrFZJb9W6WKkYlk0cgv1pZWl/otKiLkk04Aoyx4ibqtRznyvLL5QVf0j8Yvy6iBRDk7dOgIWReTGmbMAsrhv48muVnyoyNfCe8VoDBi6o9efnuaQ1Y/A+P7c4QQDxaKTR7pTjrl/wSb2UMoLOuHr1reZO3EFyHOJzFNd5brOWBsKOGXsuW3AC7D+DN/xxybornCbx5UATtjtRNCqmX4vlL8X+/m9Cjscq3tvU+Iv1EFQI94cVIZZ9lm2mjpEKi5r8vQF5CXt57+X9VrRqdyEQK/26T2ARyDHNkMEZ4pW/uYKZEGcFwXlS7X/S6ENXidBRoHA== Received: from [98.139.170.181] by nm26.bullet.mail.bf1.yahoo.com with NNFMP; 27 Mar 2015 14:30:56 -0000 Received: from [68.142.230.75] by tm24.bullet.mail.bf1.yahoo.com with NNFMP; 27 Mar 2015 14:30:56 -0000 Received: from [127.0.0.1] by smtp232.mail.bf1.yahoo.com with NNFMP; 27 Mar 2015 14:30:56 -0000 X-Yahoo-Newman-Id: 828470.53953.bm@smtp232.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: qnXk8CQVM1kCR7_9R9dM6B2.nMlvwhKE3v4jdsP6Cvi29NG bgpNTkElV_jHuYU4TH_PwMzft8bw5l5o8_0j.yNuFNicgLRYKGgNTH_ImWEi qQCDnU0AgeumDuRAtlcWg1B_Bxq4ol8nfyE_YGVugzHxGsGQ57.YedcouKUO z3mEDX3zdadyMvc.tojpfyS5UCflnzmnDwoFur7dwQZ4HX7Z5cnqzILBFyST RBZ_bimQwlVFveX8XGXWxtZ.6cRezWuaP7yPIPYgOGVnFgro7UChWxAEh19E K5yNO6LwgtkZZR6wa3tf2mKhE.frfQ4IklPpnm6zHm0hpmTodkP0kcTJ0ktl rZ3Ml52Qxglx1UIHqzkLrufiBdYIPh5l9e9VWhecJEIH4IyffjFnni_xKZg4 UefYJjud42lSUmXZ8EIqYdZHHjcwMm7Exr4tiCTsH9o7ibJZFGONqBDFBuHC PNq63Ngfs9Aj9ZpapvLYBqXoFefMRCgzRsG2Vtpya10xx50fr1FO16OECh1F xes24FCpjmPay4jmVb0jT4rJ_UOM_JVsj X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <551569A6.9010601@FreeBSD.org> Date: Fri, 27 Mar 2015 09:31:02 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Bruce Evans , Tijl Coosemans Subject: Re: svn commit: r280636 - head/include References: <201503252153.t2PLrInc025854@svn.freebsd.org> <20150326130403.W993@besplex.bde.org> <551376D4.4030003@FreeBSD.org> <20150326170535.U2239@besplex.bde.org> <20150326142052.6789dd50@kalimero.tijl.coosemans.org> <20150327214341.E2629@besplex.bde.org> In-Reply-To: <20150327214341.E2629@besplex.bde.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, gerald@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 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, 27 Mar 2015 14:31:03 -0000 On 03/27/15 06:01, Bruce Evans wrote: > On Thu, 26 Mar 2015, Tijl Coosemans wrote: > >> On Thu, 26 Mar 2015 17:37:53 +1100 (EST) Bruce Evans >> wrote: >>> On Wed, 25 Mar 2015, Pedro Giffuni wrote: >>>> On 03/25/15 21:14, Bruce Evans wrote: >>>>> On Wed, 25 Mar 2015, Pedro F. Giffuni wrote: >>>>>> Log: >>>>>> Temporarily revert 280458. >>>>>> >>>>>> GCC is still carries an old version of cdefs.h which doesn't >>>>>> accept multiple parameters for the nonnull attribute. >>>>>> Since this issue probably affects many ports in the tree >>>>>> we will revert it for now until gcc gets fixed. >>>>> >>>>> Note that sys/cdefs.h is supposed to work with any version of >>>>> gcc back to gcc-1, and does mostly work back to at least gcc-2.95. >>>>> The whole point of sys/cdefs.h is to provide compatibity macros >>>>> for old and other non-default compilers. Standard compilers don't >>>>> even have __attribute__(()). So no changes in future versions >>>>> of gcc will fix the previous commit. >>>> >>>> cdefs.h still works for all versions of gcc back to gcc-1 AFAICT. >>> >>> I now remember other bugs in it. I think you put the varargs stuff >>> in the non-gcc version. That won't work compilers that don't support >>> varargs for macros. Neither will not changing the non-gcc version. > > I confirmed the complete brokenness of the varargs stuff for the > non-C99 case. > Hmm ... disabling existing compiler features to get a -Wall error doesn't qualify as complete brokenness. since gcc 2.95 C99 supports vararg macros we are basically talking about support for gcc 2.8 here. >>> glibc (2.6 at least) avoids using varargs in its __nonnull() macro >>> by using the same portable method that is used in many optional >>> debugging statements including FreeBSD's KASSERT(). ... >> >> Maybe introduce a __nonnull_all macro and leave __nonnull varargs-free: >> >> #define __nonnull(x) __attribute__((__nonnull__(x))) >> #define __nonnull_all __attribute__((__nonnull__)) >> >> Then in the rare cases where multiple arguments must be nonnull but >> __nonnull_all doesn't apply you can use multiple __nonnull: >> >> int f(void *, void *, void *) __nonnull(1) __nonnull(2); > > Good idea. There aren't many functions that accept null for some > pointer args but not others. > > The multiple __nonnull() method is already used a lot. E.g., in > sys/systm.h it is used 11 times. systm.h also gives many examples > where __nonnull_all cannot be used. It cannot be used for the > strto* family because endptr can be null, or for the copyinstr() > family for similar reasons (a value may be returned indirectly > but the pointer for this is null if this value is not needed). > This would become very long for some of the functions in pthread.h. I can accept reverting the variadic macro merge in 10-stable but I really think FreeBSD 11 has to move on. Pedro.