From unknown Sun Jun 22 07:52:43 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12164: What is the right way to specify -Wno-format-contains-nul? Resent-From: Bruce Korb Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-automake@gnu.org Resent-Date: Thu, 09 Aug 2012 20:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 12164 X-GNU-PR-Package: automake X-GNU-PR-Keywords: To: 12164@debbugs.gnu.org X-Debbugs-Original-To: bug-automake@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.134454280010889 (code B ref -1); Thu, 09 Aug 2012 20:07:02 +0000 Received: (at submit) by debbugs.gnu.org; 9 Aug 2012 20:06:40 +0000 Received: from localhost ([127.0.0.1]:45239 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SzZ0B-0002pa-Ov for submit@debbugs.gnu.org; Thu, 09 Aug 2012 16:06:39 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45097) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SzZ0A-0002pT-0X for submit@debbugs.gnu.org; Thu, 09 Aug 2012 16:06:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SzYsE-00034V-24 for submit@debbugs.gnu.org; Thu, 09 Aug 2012 15:58:26 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:42825) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzYsD-00034P-Ub for submit@debbugs.gnu.org; Thu, 09 Aug 2012 15:58:25 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43019) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzYsC-0001mi-96 for bug-automake@gnu.org; Thu, 09 Aug 2012 15:58:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SzYs7-00032n-RO for bug-automake@gnu.org; Thu, 09 Aug 2012 15:58:24 -0400 Received: from mail-pb0-f41.google.com ([209.85.160.41]:51868) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzYs7-00032Z-Lb for bug-automake@gnu.org; Thu, 09 Aug 2012 15:58:19 -0400 Received: by pbbro12 with SMTP id ro12so1567496pbb.0 for ; Thu, 09 Aug 2012 12:58:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=rGwFAnzqQ6XarygObEpxrLmgen4CByx2pvtMsZBAwy8=; b=pxXHbDkwoHFHdRfSqGxbEzuslLkt/YeIDe5LrPK3Fk8pVr3IUKr+QHRzjHiZRzhLmF PBxnTnRjr/NqcodsSUsxraQC8K54FyAPSOd741fk5YZWpMM6Hpxt0JODX/temfFvL3PW TUwREOfKQI6RexaPHSZLzCSVFC9JzN75Y6gydnqcZUmTlsecmvnst7RCHJmeusHiBaQz jLVwfz2b67+93L9VjP4wU/ccKJAmMSWcCA+IClICPAIh07b31h4E4y3biz0HmQ+X9Nma cmTr9zZhupHrK+bl0wRaAuJI6fhS4ojgFGgSqkWJDO74CauIJmLcGziLml6RiB/IgTFm +LtA== Received: by 10.68.129.38 with SMTP id nt6mr6680965pbb.76.1344542298643; Thu, 09 Aug 2012 12:58:18 -0700 (PDT) Received: from [192.168.10.2] (adsl-76-254-26-157.dsl.pltn13.sbcglobal.net. [76.254.26.157]) by mx.google.com with ESMTPS id nv6sm1720790pbc.42.2012.08.09.12.58.17 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 09 Aug 2012 12:58:18 -0700 (PDT) Message-ID: <50241658.5030208@gmail.com> Date: Thu, 09 Aug 2012 12:58:16 -0700 From: Bruce Korb User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) Hi, It seems that AM_PROG_CC likes to default CFLAGS to "-g -Wall" and COMPILE puts CFLAGS at the end of the option list. That means that -Wall over-rides my AM_CFLAGS setting and chokes and dies. My library uses a large array of bytes to hold many strings, some of which are formatting strings and gcc is really clever about noticing that there are embedded NUL bytes separating each substring. (I actually added -Wno-format-contains-nul shortly after this new cleverness was added...) The deal is that if someone does a: make CFLAGS='-Dsomethingforme -Wall' and I were to add this nul thingey to the end of CFLAGS, then my effort is for naught. I think it useful to have a PROJECT_CFLAGS that always gets stuck at the end in the COMPILE macro. Meanwhile, I'll specify it twice -- once in CFLAGS and again in AM_CFLAGS in hopes it remains active regardless. (Actually, gcc probably ought not override a specifically set option with a "-Wall", but this the wrong forum for that...) Thanks - Bruce From unknown Sun Jun 22 07:52:43 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12164: What is the right way to specify -Wno-format-contains-nul? Resent-From: Stefano Lattarini Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-automake@gnu.org Resent-Date: Thu, 09 Aug 2012 21:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12164 X-GNU-PR-Package: automake X-GNU-PR-Keywords: To: Bruce Korb Cc: 12164@debbugs.gnu.org Received: via spool by 12164-submit@debbugs.gnu.org id=B12164.134454705220475 (code B ref 12164); Thu, 09 Aug 2012 21:18:01 +0000 Received: (at 12164) by debbugs.gnu.org; 9 Aug 2012 21:17:32 +0000 Received: from localhost ([127.0.0.1]:45331 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sza6m-0005KB-4o for submit@debbugs.gnu.org; Thu, 09 Aug 2012 17:17:32 -0400 Received: from mail-we0-f172.google.com ([74.125.82.172]:58519) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sza6j-0005Jz-Rw; Thu, 09 Aug 2012 17:17:30 -0400 Received: by weyu54 with SMTP id u54so593920wey.3 for ; Thu, 09 Aug 2012 14:09:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=AvbQTXfDv8biJCdtr3G+tPQL3Tdzo3rVwQmzRJQB4VA=; b=Xr1dEtzTfBsDyH+fSiT24xDFWQtundRE5qtnweY8SWzd62Jf6HFFcpQHbDtDyq5uUh 0KbgO8KrMTu6NcnuK6KOftM/mJNBr+iTyVw2565rdnSwZ+CZ0XZc0Jed+uOyzAqOkzAM n82Ogmp1MqvqPCxNxAC8T19DzUMBqAahtbImraOLvFSf/Ud99z4ObMWSQQXvM3mRNXVH 6AqarwHeVrm2Z/sTJc26DrWttHTVLBltVYzq6FyRA94huUgEyDpZgM3ckpwYRxPcnnMU 6A1xemAYCslgoikQfH5phqXhzfqYvJlcPqz6IeAA+9IlruAuI2PzkdW1m76HJBqGyOrW R9QQ== Received: by 10.180.20.204 with SMTP id p12mr1541387wie.7.1344546557005; Thu, 09 Aug 2012 14:09:17 -0700 (PDT) Received: from [192.168.178.21] (host152-95-dynamic.2-87-r.retail.telecomitalia.it. [87.2.95.152]) by mx.google.com with ESMTPS id j6sm5622218wiy.4.2012.08.09.14.09.15 (version=SSLv3 cipher=OTHER); Thu, 09 Aug 2012 14:09:16 -0700 (PDT) Message-ID: <502426FA.7080105@gmail.com> Date: Thu, 09 Aug 2012 23:09:14 +0200 From: Stefano Lattarini MIME-Version: 1.0 References: <50241658.5030208@gmail.com> In-Reply-To: <50241658.5030208@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) severity 12164 wishlist tags 12164 wontfix thanks On 08/09/2012 09:58 PM, Bruce Korb wrote: > Hi, > > It seems that AM_PROG_CC > Huh? There is no such think like 'AM_PROG_CC'. I guess you mean AC_PROG_CC. > likes to default CFLAGS to "-g -Wall" > Since AC_PROG_CC comes from Autoconf, this is not due to Automake in any way. Maybe you should ask on their list how to prevent this from happening. > and COMPILE puts CFLAGS at the end of the option list. > Rightly so, because user overrides are expected to always take precedence. > That means that -Wall over-rides my AM_CFLAGS setting and chokes > and dies. > How can -Wall cause the compiler to die? Have you added -Werror to $(AM_CFLAGS) maybe? > My library uses a large array of bytes to hold many strings, > some of which are formatting strings and gcc is really clever about > noticing that there are embedded NUL bytes separating each substring. > (I actually added -Wno-format-contains-nul shortly after this new > cleverness was added...) The deal is that if someone does a: > > make CFLAGS='-Dsomethingforme -Wall' > > and I were to add this nul thingey to the end of CFLAGS, then > my effort is for naught. I think it useful to have a PROJECT_CFLAGS > that always gets stuck at the end in the COMPILE macro. > This would go against the principle that "the user is always right (when he is explicit)". If your users want to instruct your package to do something stupid, allow them; it might turn out that what might seem stupid is actually subtly clever or useful in some corner-case situations. So, in this case above, the user will just learn to add a '-Wno-error' option to his CFLAGS if he wants to avoid spurious errors; maybe he is using '-Wall' not to cause extra errors, but because he wants to see which the warnings you have disabled are, for his own reasons (good or bad, that is not for us to speculate about). Your proposed idiom would prevent him from doing so easily. We can't start trying to double-guess or out-smart the user: there lies madness (and some Windows programs ;-) Because, in the end, what would prevent the user from overriding $(PROJECT_CFLAGS) as well? > Meanwhile, I'll specify it twice -- once in CFLAGS and again in AM_CFLAGS > in hopes it remains active regardless. > This way, you are preventing your user a way to define $(CFLAGS) himself; not a good move. > (Actually, gcc probably ought not override a specifically set option > with a "-Wall", but this the wrong forum for that...) > > Thanks - Bruce > Regards, Stefano From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 26 09:29:43 2013 Received: (at control) by debbugs.gnu.org; 26 Dec 2013 14:29:43 +0000 Received: from localhost ([127.0.0.1]:43091 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VwBwS-0004w6-Ez for submit@debbugs.gnu.org; Thu, 26 Dec 2013 09:29:41 -0500 Received: from mail-ea0-f177.google.com ([209.85.215.177]:53099) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VwBwO-0004vt-Q4 for control@debbugs.gnu.org; Thu, 26 Dec 2013 09:29:37 -0500 Received: by mail-ea0-f177.google.com with SMTP id n15so3713791ead.8 for ; Thu, 26 Dec 2013 06:29:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:mime-version:to:subject:content-type :content-transfer-encoding; bh=RupFwy88bRMmmKUzAutzr8WZwlyVAjZi1+ewQbHn1zk=; b=y6ff8b3SVrbxvfb6x4PRwTsocKxwYwWRrhGEgybqJ+Ya829p99oAxtdhr3PBFQnKGD H0g0zRskdSbthb2Xh8AHYOwsONkm8WNTCwZsVUZ/NRrFVgZYi777wcVnpv6KYTLiXsDf i8Ex/qDyrYP2IIX7a2AsdB/yESUf6we8PUHNhj73dLZQOH7c2d2Q+EDQxkqgrpObeyGe kozkuwMJ5FUgkwS3CDGreyvs+2SLCEo+d69DVReQi0SVC/6VG2kwjVXX2q9wfb4ww/Yk L9qHxFTZrt4rrTzo6b75PlVXjhI3yidBEBTtgQDJgNATqK0YkYBo6/qTBkE9ynjBEPR2 to7g== X-Received: by 10.14.100.4 with SMTP id y4mr37336645eef.40.1388068175709; Thu, 26 Dec 2013 06:29:35 -0800 (PST) Received: from [192.168.0.101] (host143-4-dynamic.5-87-r.retail.telecomitalia.it. [87.5.4.143]) by mx.google.com with ESMTPSA id h3sm73266854eem.15.2013.12.26.06.29.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 26 Dec 2013 06:29:34 -0800 (PST) Message-ID: <52BC3D40.1070308@gmail.com> Date: Thu, 26 Dec 2013 15:29:20 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: GNU bug tracker automated control server Subject: x Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) close 16205 close 12657 close 12164 stop