Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp385841imn; Thu, 28 Jul 2022 03:58:49 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vwrMR/LXh6ju9n8HJwSXQvxy3PvGg6SC820ycu8ffOs0kyaN6risesdAyHrv/WlOSG/WLP X-Received: by 2002:a17:906:dc8a:b0:72b:7649:f5bb with SMTP id cs10-20020a170906dc8a00b0072b7649f5bbmr1217394ejc.637.1659005929717; Thu, 28 Jul 2022 03:58:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659005929; cv=none; d=google.com; s=arc-20160816; b=Yx58ybLc3SuWo+2oQR80PBXvpl93xUpTrtQQOvAoKRj9KhtnqSak4YUMsL51+oB4so 4OfIvz7zCdz/vvy+K5wNo1I9b6lUZBYLw5oTMxpf7xpH0eQin2NEFqITfFlyl4EToDLD xuNhI0pI7GpHAQS2fF6g/pIDiBaXe33KDPtPm0v7C1Oeh0ytm/7FDqzfoA8QYxlaHsDj dnfP0Zw9v0vYrRo1ipwuZatUNqvQNbL4TGXK27t7Udo4CnmiogJVH2ZKk49CTcK6cCOP /oOgxMZOs/FtKr4DNZq2+hbsdlC3maVAQrQApS0lJJ2cs1Q9LHOH728Qkc0SgpCeBgwJ Hfjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=I4L3qc5+151HmmRgPtNa+xmMNqlZi95xVHkUHYV5uRo=; b=qEj/aAQl2mAKqkaiiamfikHUm88lqcEtFkpDv34wSxK7IO66A++T62AkaKHVlfBQ2G agDzncjlh/7rZwfmQgsCFJVCmLq22K/E1oJV+BYRrLpLDYbMeMxq+KcqlUw1LQ4ElWII 7es3Nz6J37mdHjsGyL19Q6xgDvH+fnhfxj0auHGH8e5D7BK5dEijCn9ZFdF7NwRjOvlB g5Svgy7XiN/EAlSbytLG3QRiOrouKHWjyRqjqkJV1ZUCj8N8Th11rG3XbXwrk/Oh66j2 l2YT36+rDdH+3NMXeuzO60fU7cGNpv75wwCROBxfir5n0+kWS8l6zg8e94eVeNcJjmdB vdMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=aYeJGV4w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id vf19-20020a170907239300b006ff278107bbsi361304ejb.597.2022.07.28.03.58.24; Thu, 28 Jul 2022 03:58:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=aYeJGV4w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235901AbiG1KF0 (ORCPT + 99 others); Thu, 28 Jul 2022 06:05:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235889AbiG1KFX (ORCPT ); Thu, 28 Jul 2022 06:05:23 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1BCC42AE0 for ; Thu, 28 Jul 2022 03:05:20 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id B201235312; Thu, 28 Jul 2022 10:05:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1659002719; 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=I4L3qc5+151HmmRgPtNa+xmMNqlZi95xVHkUHYV5uRo=; b=aYeJGV4wYLD8CmxhgkbWsJEdn9HsfBe7MX+7DSe3AF3YRhu1L4xhBOpnvoXbdSEw5Q+NnS Vxpl33lvejau2J9C/3PSb1CXCqc8r8V2uZuTUwStWJAgi0ZA3nmsWxwaxURC8Bd4yDAOql i82QsQyq8nUZRjRUOvPUnYalr2ZQ214= Received: from suse.cz (unknown [10.100.208.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 0F63B2C142; Thu, 28 Jul 2022 10:05:18 +0000 (UTC) Date: Thu, 28 Jul 2022 12:05:18 +0200 From: Petr Mladek To: Nathan Chancellor Cc: Justin Stitt , ndesaulniers@google.com, andriy.shevchenko@linux.intel.com, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, rostedt@goodmis.org, senozhatsky@chromium.org, trix@redhat.com Subject: Re: [PATCH v4] lib/test_printf.c: fix clang -Wformat warnings Message-ID: References: <20220718230626.1029318-1-justinstitt@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 2022-07-27 12:39:32, Nathan Chancellor wrote: > Hi Petr, > > On Tue, Jul 19, 2022 at 02:17:47PM +0200, Petr Mladek wrote: > > On Mon 2022-07-18 16:06:26, Justin Stitt wrote: > > > see warnings: > > > | lib/test_printf.c:157:52: error: format specifies type 'unsigned char' > > > | but the argument has type 'int' [-Werror,-Wformat] > > > test("0|1|1|128|255", > > > | "%hhu|%hhu|%hhu|%hhu|%hhu", 0, 1, 257, 128, -1); > > > - > > > | lib/test_printf.c:158:55: error: format specifies type 'char' but the > > > | argument has type 'int' [-Werror,-Wformat] test("0|1|1|-128|-1", > > > | "%hhd|%hhd|%hhd|%hhd|%hhd", 0, 1, 257, 128, -1); > > > - > > > | lib/test_printf.c:159:41: error: format specifies type 'unsigned > > > short' > > > | but the argument has type 'int' [-Werror,-Wformat] > > > | test("2015122420151225", "%ho%ho%#ho", 1037, 5282, -11627); > > > > > > There's an ongoing movement to eventually enable the -Wformat flag for > > > clang. Previous patches have targeted incorrect usage of > > > format specifiers. In this case, however, the "incorrect" format > > > specifiers are intrinsically part of the test cases. Hence, fixing them > > > would be misaligned with their intended purpose. My proposed fix is to > > > simply disable the warnings so that one day a clean build of the kernel > > > with clang (and -Wformat enabled) would be possible. It would also keep > > > us in the green for alot of the CI bots. > > > > > > Link: https://github.com/ClangBuiltLinux/linux/issues/378 > > > Suggested-by: Nathan Chancellor > > > Suggested-by: Nick Desaulniers > > > Signed-off-by: Justin Stitt > > > > Looks good to me: > > > > Reviewed-by: Petr Mladek > > Would you be able to take this for 5.20 or should we ask Andrew to pick > it up? It seems you two seem to split applying patches to this file and > we are trying to get -Wformat enabled for clang in 5.20. I take most vsprintf-related patches via the printk git tree last few years. Anyway, I have just committed the patch into printk/linux.git, branch for-5.20. Best Regards, Petr