From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 20DDB3858C27 for ; Wed, 8 Dec 2021 23:17:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 20DDB3858C27 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from reform (deer0x03.wildebeest.org [172.31.17.133]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 1A8963000ED0 for ; Thu, 9 Dec 2021 00:17:33 +0100 (CET) Received: by reform (Postfix, from userid 1000) id DD6F52E821A0; Thu, 9 Dec 2021 00:17:16 +0100 (CET) Date: Thu, 9 Dec 2021 00:17:16 +0100 From: Mark Wielaard To: elfutils-devel@sourceware.org Subject: Re: [PATCH] tests: varlocs workaround format-overflow errors Message-ID: References: <20211204212729.276818-1-mark@klomp.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20211204212729.276818-1-mark@klomp.org> X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2021 23:17:35 -0000 On Sat, Dec 04, 2021 at 10:27:29PM +0100, Mark Wielaard wrote: > In function ‘printf’, > inlined from ‘handle_attr’ at varlocs.c:932:3: > error: ‘%s’ directive argument is null [-Werror=format-overflow=] > > The warning is technically correct. A %s argument should not be > NULL. Although in practice all implementations will print it as > "(null)". Workaround this by simply changing the dwarf string > functions to return an "" string. The test is for the correct > names, either "(null)" or "" would make it fail (also remove > a now unnecessary assert, the switch statement will check for unknown > opcodes anyway). Pushed, Mark