GNU bug report logs - #78659
[PATCH] Pacify Clang's -Wformat-signedness.

Previous Next

Package: emacs;

Reported by: Collin Funk <collin.funk1 <at> gmail.com>

Date: Sun, 1 Jun 2025 05:17:05 UTC

Severity: normal

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Collin Funk <collin.funk1 <at> gmail.com>
Subject: bug#78659: closed (Re: bug#78659: [PATCH] Pacify Clang's
 -Wformat-signedness.)
Date: Mon, 02 Jun 2025 07:28:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#78659: [PATCH] Pacify Clang's -Wformat-signedness.

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 78659 <at> debbugs.gnu.org.

-- 
78659: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=78659
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Collin Funk <collin.funk1 <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 78659-done <at> debbugs.gnu.org
Subject: Re: bug#78659: [PATCH] Pacify Clang's -Wformat-signedness.
Date: Mon, 2 Jun 2025 00:27:31 -0700
On 2025-06-01 18:04, Collin Funk wrote:
> How about just disabling this warning if Clang is being used like we do
> for many others?

Thanks, I installed that. Closing the bug report.

[Message part 3 (message/rfc822, inline)]
From: Collin Funk <collin.funk1 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Pacify Clang's -Wformat-signedness.
Date: Sat, 31 May 2025 22:16:15 -0700
[Message part 4 (text/plain, inline)]
Hi,

When compiling with './autogen.sh && ./configure CC=clang && make':

    [...]
    xfns.c:2041:6: warning: format specifies type 'unsigned int' but the argument has type 'int' [-Wformat]
     2040 |           sprintf (css, "scrollbar slider { background-color: #%02x%02x%02x; }",
          |                                                                ~~~~
          |                                                                %02x
     2041 |                    color.red >> 8, color.green >> 8, color.blue >> 8);
    [...]

This warning is harmless, but interestingly 'gcc -Wformat-signedness'
does not warn about it, but 'clang -Wformat-signedness' does.

Since the color fields of struct XColor are 'unsigned short' and the
constant is an 'int', the expression should be an 'int'.

Anyways, the attached patch silences the warnings.

Collin

[0001-Pacify-Clang-s-Wformat-signedness.patch (text/x-patch, attachment)]

This bug report was last modified 11 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.