From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#74971: [PATCH] Fix format specifier warnings in nsterm.m Date: Thu, 26 Dec 2024 09:54:31 +0200 Message-ID: <86frmazxoo.fsf@gnu.org> References: <20241219132805.9262-1-charmitro@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34454"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 74971@debbugs.gnu.org To: Charalampos Mitrodimas , Gerd =?UTF-8?Q?M=C3=B6llmann?= , Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 26 08:55:17 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tQiiC-0008ov-Sy for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 26 Dec 2024 08:55:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tQii0-0001zT-Ko; Thu, 26 Dec 2024 02:55:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tQihy-0001xq-M7 for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2024 02:55:02 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQihy-00060t-B1 for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2024 02:55:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-version:References:In-Reply-To:From:Date:To:Subject; bh=nliWs9fipkhHSuRXCWaxwBZcQZMMYDjmNIa0a764AX4=; b=VT2ILIXrqxYTT5xzjZ81MuSl7Mgv01Bzz3DnrSE70oZ+AmXUnIk5tXRzVsDne3m81HKEytxocqaWE6W5SXaFZZD33W0SvlwoR7KecuNZ5iygRc25KfB9AzRimVKnKk5PsFbMCQ1rh5oR1iIlDy9NDCgI+ahPP6lKD3bgDOlWMN2qSlSeGIFQPE5oVxj/CZ58acZ0S7TQ7wx4Y8I3ylzK3QvzMamfbysF3+olNVa6IETJ54AehquC2iX64XSrvflu6fnmB/YZxVGfg/v54e2trmQSNA9FkoMO3iZ+KiUcUjNfST3aiyR5VyBR3aMkbxYuwll3XvDgxPZDTNQPCwlqXw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tQihx-0007Nv-Tc for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2024 02:55:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Dec 2024 07:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74971 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 74971-submit@debbugs.gnu.org id=B74971.173519968128343 (code B ref 74971); Thu, 26 Dec 2024 07:55:01 +0000 Original-Received: (at 74971) by debbugs.gnu.org; 26 Dec 2024 07:54:41 +0000 Original-Received: from localhost ([127.0.0.1]:39938 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQihc-0007N5-Gy for submit@debbugs.gnu.org; Thu, 26 Dec 2024 02:54:40 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:37380) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQiha-0007Ms-JB for 74971@debbugs.gnu.org; Thu, 26 Dec 2024 02:54:39 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tQihV-0005zg-7y; Thu, 26 Dec 2024 02:54:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=nliWs9fipkhHSuRXCWaxwBZcQZMMYDjmNIa0a764AX4=; b=X7+GeQE7PrVQdqLyG4I/ tk2hSC+FqFnKIYBiG8v/chXqyd/NDjimVJaNOR/AMm1MMLhiD2GOTDRnVAjnaln0bs4Jw5ShK/LhP eOl2nWRSd/Bua4wKec/FU+Snxy3uhYZLQXducXWgo1M6TnOGyi+fd8Lqcx3HANieIZHo698xGQt1O B3W5TK0phh/3h8IFOgN8QZf87so0fM+dAvHj5byug+K54PhRF+DeWcd6tyVGcTUwYmOlPUIkEWLos j4+rz4UXlCG4MVDul5igbewBhb1cN5FLIIOdz9NFnbtdfIqIwo/bcP2DVwZv6komxpcYQ1jeWNriw nVK6COUKlB9IlA==; In-Reply-To: <20241219132805.9262-1-charmitro@posteo.net> (message from Charalampos Mitrodimas on Thu, 19 Dec 2024 13:28:05 +0000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:297750 Archived-At: > Cc: Charalampos Mitrodimas > From: Charalampos Mitrodimas > Date: Thu, 19 Dec 2024 13:28:05 +0000 > > Resolve warnings caused by mismatched format specifiers in `NSLog` and > `fprintf` calls. > > This was observed when compiled with Clang version > 19.1.6 (arm64-apple-darwin). > > * src/nsterm.m: Cast `IOReturn` (aka `int`) to `unsigned int` for `%x` > format specifiers in `NSLog`. > > Warnings fixed: > - "format specifies type 'unsigned int' but the argument has type > 'IOReturn' (aka 'int')" > --- > src/nsterm.m | 17 +++++++++++------ > 1 file changed, 11 insertions(+), 6 deletions(-) > > diff --git a/src/nsterm.m b/src/nsterm.m > index c705a3c78f4..5793bb961e8 100644 > --- a/src/nsterm.m > +++ b/src/nsterm.m > @@ -6955,8 +6955,12 @@ In that case we use UCKeyTranslate (ns_get_shifted_character) > > #ifndef NS_IMPL_GNUSTEP > if (NS_KEYLOG) > - fprintf (stderr, "keyDown: code =%x\tfnKey =%x\tflags = %x\tmods = %x\n", > - code, fnKeysym, flags, emacs_event->modifiers); > + fprintf (stderr, > + "keyDown: code = %x\tfnKey = %x\tflags = %x\tmods = " > + "%x\n", > + (unsigned int) code, (unsigned int) fnKeysym, > + (unsigned int) flags, > + (unsigned int) emacs_event->modifiers); > #endif > > /* If it was a function key or had control-like modifiers, pass > @@ -10761,7 +10765,7 @@ - (CGContextRef) getContext > > IOReturn lockStatus = IOSurfaceLock (surface, 0, nil); > if (lockStatus != kIOReturnSuccess) > - NSLog (@"Failed to lock surface: %x", lockStatus); > + NSLog (@"Failed to lock surface: %x", (unsigned int)lockStatus); > > [self copyContentsTo:surface]; > > @@ -10808,7 +10812,7 @@ - (void) releaseContext > > IOReturn lockStatus = IOSurfaceUnlock (currentSurface, 0, nil); > if (lockStatus != kIOReturnSuccess) > - NSLog (@"Failed to unlock surface: %x", lockStatus); > + NSLog (@"Failed to unlock surface: %x", (unsigned int)lockStatus); > } > > > @@ -10849,7 +10853,8 @@ - (void) copyContentsTo: (IOSurfaceRef) destination > > lockStatus = IOSurfaceLock (source, kIOSurfaceLockReadOnly, nil); > if (lockStatus != kIOReturnSuccess) > - NSLog (@"Failed to lock source surface: %x", lockStatus); > + NSLog (@"Failed to lock source surface: %x", > + (unsigned int) lockStatus); > > sourceData = IOSurfaceGetBaseAddress (source); > destinationData = IOSurfaceGetBaseAddress (destination); > @@ -10861,7 +10866,7 @@ - (void) copyContentsTo: (IOSurfaceRef) destination > > lockStatus = IOSurfaceUnlock (source, kIOSurfaceLockReadOnly, nil); > if (lockStatus != kIOReturnSuccess) > - NSLog (@"Failed to unlock source surface: %x", lockStatus); > + NSLog (@"Failed to unlock source surface: %x", (unsigned int)lockStatus); > } > > #undef CACHE_MAX_SIZE > -- > 2.47.1 Thanks. Stefan and Gerd, would you please review this and advise or install?