From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F059DC00140 for ; Fri, 5 Aug 2022 09:32:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236064AbiHEJcp (ORCPT ); Fri, 5 Aug 2022 05:32:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235839AbiHEJco (ORCPT ); Fri, 5 Aug 2022 05:32:44 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52DF9101CA for ; Fri, 5 Aug 2022 02:32:43 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id E860B20329; Fri, 5 Aug 2022 09:32:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1659691961; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0G0uLbaaUiW/DLpzUjyIgCLqiJXod15Uj+qglPR6Ej4=; b=DiG4+kEvZb0XL9LNyqQuxyQ4heGbqtkXj147kiK51B3SU1MbNOmweDNi4OEDFWxJYGHa50 hxo0911gwwEvVXYcJ4v1hzICycT+xW6Ygtmi11HO4PtHg+inyGAZduIsvBqAmh+Lu01CoN NEV4tksgilVnCnwo4FgiGFQ0fWivEtE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1659691961; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0G0uLbaaUiW/DLpzUjyIgCLqiJXod15Uj+qglPR6Ej4=; b=TcNaoQLg5nXFkEYsiH6XbI2L9Z3d1Z/jR36TPE4J8WgAcxCgdBAXmCu4zQxau9Y4x9Y4j3 UeyLagjbiK++5gDw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C7F7E133B5; Fri, 5 Aug 2022 09:32:41 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id gkb7Lrnj7GKHVQAAMHmgww (envelope-from ); Fri, 05 Aug 2022 09:32:41 +0000 Date: Fri, 5 Aug 2022 11:34:31 +0200 From: Cyril Hrubis To: Petr Vorel Cc: ltp@lists.linux.it, linux-nfs@vger.kernel.org, Andrea Cervesato Subject: Re: [PATCH 1/1] aiodio: Fix format string for 32bit Message-ID: References: <20220803173211.14292-1-pvorel@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220803173211.14292-1-pvorel@suse.cz> Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Hi! > On 32bit char pointer is int and size_t is unsigned int, > Cast to long / unsigned long. Actually char pointer is char pointer, that is not an integer type at all. If you do a pointer difference you end up with an signed integer value of ptrdiff_t type, because unlike the result of sizeof(foo) pointer difference can be negative as well. In C99 ptrdiff_t can be printed as %td see the "Length modifier" part of man 3 printf. -- Cyril Hrubis chrubis@suse.cz From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 832A9C00140 for ; Fri, 5 Aug 2022 09:32:57 +0000 (UTC) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 578AC3C94B4 for ; Fri, 5 Aug 2022 11:32:55 +0200 (CEST) Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [IPv6:2001:4b78:1:20::4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id E63A53C54ED for ; Fri, 5 Aug 2022 11:32:45 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-4.smtp.seeweb.it (Postfix) with ESMTPS id 967BC10000EA for ; Fri, 5 Aug 2022 11:32:43 +0200 (CEST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id E860B20329; Fri, 5 Aug 2022 09:32:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1659691961; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0G0uLbaaUiW/DLpzUjyIgCLqiJXod15Uj+qglPR6Ej4=; b=DiG4+kEvZb0XL9LNyqQuxyQ4heGbqtkXj147kiK51B3SU1MbNOmweDNi4OEDFWxJYGHa50 hxo0911gwwEvVXYcJ4v1hzICycT+xW6Ygtmi11HO4PtHg+inyGAZduIsvBqAmh+Lu01CoN NEV4tksgilVnCnwo4FgiGFQ0fWivEtE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1659691961; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0G0uLbaaUiW/DLpzUjyIgCLqiJXod15Uj+qglPR6Ej4=; b=TcNaoQLg5nXFkEYsiH6XbI2L9Z3d1Z/jR36TPE4J8WgAcxCgdBAXmCu4zQxau9Y4x9Y4j3 UeyLagjbiK++5gDw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C7F7E133B5; Fri, 5 Aug 2022 09:32:41 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id gkb7Lrnj7GKHVQAAMHmgww (envelope-from ); Fri, 05 Aug 2022 09:32:41 +0000 Date: Fri, 5 Aug 2022 11:34:31 +0200 From: Cyril Hrubis To: Petr Vorel Message-ID: References: <20220803173211.14292-1-pvorel@suse.cz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220803173211.14292-1-pvorel@suse.cz> X-Virus-Scanned: clamav-milter 0.102.4 at in-4.smtp.seeweb.it X-Virus-Status: Clean Subject: Re: [LTP] [PATCH 1/1] aiodio: Fix format string for 32bit X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-nfs@vger.kernel.org, ltp@lists.linux.it Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ltp-bounces+ltp=archiver.kernel.org@lists.linux.it Sender: "ltp" Hi! > On 32bit char pointer is int and size_t is unsigned int, > Cast to long / unsigned long. Actually char pointer is char pointer, that is not an integer type at all. If you do a pointer difference you end up with an signed integer value of ptrdiff_t type, because unlike the result of sizeof(foo) pointer difference can be negative as well. In C99 ptrdiff_t can be printed as %td see the "Length modifier" part of man 3 printf. -- Cyril Hrubis chrubis@suse.cz -- Mailing list info: https://lists.linux.it/listinfo/ltp