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:05 +0200 Message-ID: <86h66qzxpe.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="28305"; 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 09:04:11 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 1tQiqo-00079e-VN for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 26 Dec 2024 09:04:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tQiqi-00053F-RF; Thu, 26 Dec 2024 03:04: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 1tQiqg-00052p-VS for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2024 03:04:03 -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 1tQiqg-0006zP-M2 for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2024 03:04: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=cp2HTXYC3sHppKcbX1VmdjMYYsgTusw6USljpfND1h34wXHw1YWtiZ6gjDqs+NHACijsM4wGYjdy6LNe+fQ2MlzAePpuRTm8gk18xzH1C6JSmzh6OvW8ZHJfdfJ2RuLVBwLf17xzeV2jTx6Z14VTvNXoxcpUvCmORDGLF7uraGGgAA56yD6nAqS3U6xQAg0KBkfNt56yv8S60HKObPzfNBloEfPKG3e0WI+dWOFtOGe57AOenD13tr3eOFFMOl3uLKRrAr1o1iJ4yASkVXUnv8iA70M3a8fc/kMQJ480oF78D885sb8zRxCyCiItB0E0SAK5fv4wmP2OGoLVwtZAMw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tQiqg-0007rC-GZ for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2024 03:04:02 -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 08:04:02 +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.173520023130183 (code B ref 74971); Thu, 26 Dec 2024 08:04:02 +0000 Original-Received: (at 74971) by debbugs.gnu.org; 26 Dec 2024 08:03:51 +0000 Original-Received: from localhost ([127.0.0.1]:39962 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQiqV-0007qk-4h for submit@debbugs.gnu.org; Thu, 26 Dec 2024 03:03:51 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:49192) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQiqT-0007qO-1z for 74971@debbugs.gnu.org; Thu, 26 Dec 2024 03:03:49 -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 1tQih6-0005x7-0B; Thu, 26 Dec 2024 02:54:08 -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=crkPLf/Jt2iEprVyQNko K2Ngzcl6CLJeZuWqtBwSAttWsI7t20w3rMoMhLriZFS8E07FFTjJJf1foplVYQg4aYqkLs8Q3+GXC tO/fPYx/CHTXmV3oVnAcnTmUjMVXbwGPW9mK1miYhqvxTwc1BxI+F95bDZOWIIh0busKR6gVsiYTs AmgYYHX7rpqFvMbXvvHERs6OMTPt1twP5Ntbrv58lBLLGT+CCA1SaxcBbbXF+cvSbN4yyzPd8UiTd TVjKFJJNW4bR9eSG/TaMmiY9GQDi0+C0FMl3B0GblIsDFmkr/C3vCOhZnvPratrFofLrPbpBrzbTn vynxUIxPLWTyug==; 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:297752 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?