From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 25 12:53:12 2013 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 131CD296; Fri, 25 Oct 2013 12:53:12 +0000 (UTC) (envelope-from dhartmei@insomnia.benzedrine.cx) Received: from insomnia.benzedrine.cx (cust.static.213-3-30-106.swisscomdata.ch [213.3.30.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7CC0F243A; Fri, 25 Oct 2013 12:53:10 +0000 (UTC) Received: from insomnia.benzedrine.cx (localhost [127.0.0.1]) by insomnia.benzedrine.cx (8.14.6/8.14.5) with ESMTP id r9PCQhtq022198 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 25 Oct 2013 14:26:43 +0200 (MEST) Received: (from dhartmei@localhost) by insomnia.benzedrine.cx (8.14.6/8.14.5/Submit) id r9PCQhPH016909; Fri, 25 Oct 2013 14:26:43 +0200 (MEST) Date: Fri, 25 Oct 2013 14:26:43 +0200 From: Daniel Hartmeier To: freebsd-hackers@freebsd.org, hackers@freebsd.org Subject: Re: warning spew from cddl libnvpair.c Message-ID: <20131025122643.GC12556@insomnia.benzedrine.cx> References: <1382672957.18382.11.camel@localhost> <20131025113946.GA15905@britannica.bec.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131025113946.GA15905@britannica.bec.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 12:53:12 -0000 How is that valid? If nvprt_btwnarrfmt contains %, how would (void) fprintf(fp, pctl->nvprt_btwnarrfmt); \ not crash? And if it may not contain %, why not use (void) fprintf(fp, "%s", pctl->nvprt_btwnarrfmt); \ It can be set to arbitrary values with libnvpair.c nvlist_prtctl_setfmt() That's exactly why the compiler warns, no? If anything in the macro/preprocessor trickery is relevant, I'm not seeing it. Daniel