Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6677776rwb; Mon, 12 Dec 2022 05:12:34 -0800 (PST) X-Google-Smtp-Source: AA0mqf770GWbtHe8aUD/etKaQgZ493UzqVzeaGiON5LOmlbEySZDPst+p0NpFmA6DFc/l1I3n2qe X-Received: by 2002:a05:6a20:320e:b0:aa:7548:883d with SMTP id y14-20020a056a20320e00b000aa7548883dmr29656040pzc.11.1670850754031; Mon, 12 Dec 2022 05:12:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670850754; cv=none; d=google.com; s=arc-20160816; b=dreKlyNWudppC+quoKexM5Y3SWIKLR0V9IITq+twXWV/5Lg45J2ahtMCDjSQHa0qWi rGBO3i0O0ibjKAWzsEyOALtk6hOC5tPlK8O1hmFTweDvhtkM2mNa6+QMtu+7x32jluc/ 1iCC/py0DclpmvSPWuFb7lLUhnaZVv+ltK79r6+i3WVEZ/CUtu9+otpWlFpikhVU4iPy mKTwh+xfv2AK4X4EWUiLrUAiabcZWCUioo7t+vpoL9ACX1+hK1RY8Is5svQCmTBFdq3M hBpuRD4y1GcLSBV2wP/YDhr2K5sSyzjfQBFpMxyN67FsR2aP4A2ffVJPY8piVjZsbrBU Dyrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id; bh=lE6rZOS9ffH/Yk3dYNMYdk596yZemDJvPNi7MI+99fc=; b=njcdfz0yCB5Yc4NfOCltDfZLaRlKS8GT2S35jUrWwSNO9KzFRFUrqSEP1eWH2gT/gF /JXhSTYGwyA7s1Jkge8sMJ1gBKeS4O6+oCKpQCqs0Gxn/Wf8YDinayOFygpfcenb8E6C 6saCt4+YvV9wOkcxBfm1MlHZvul5Czmmiy3NtwTAMeeIjTU+5MT0mSnzUgixUgm0wQp8 9k8mo3ccwJhZNcfDG7P/xp0xeyG8fh7GB6MCERDz2ke6w58Gx5GVfh94RwSMUbWOeVKL unADUaLufELamv1aTv7G5qO+pji6r87FoNFrCiR5yd8bMxSZUixgQ7wxMTwgJw+erO8a xMeg== ARC-Authentication-Results: i=1; mx.google.com; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h192-20020a636cc9000000b0047959422029si1273596pgc.395.2022.12.12.05.12.23; Mon, 12 Dec 2022 05:12:34 -0800 (PST) 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; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231864AbiLLMOk (ORCPT + 75 others); Mon, 12 Dec 2022 07:14:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231362AbiLLMOg (ORCPT ); Mon, 12 Dec 2022 07:14:36 -0500 Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D3D9D4C; Mon, 12 Dec 2022 04:14:35 -0800 (PST) Received: by mail-ed1-f52.google.com with SMTP id l11so12559295edb.4; Mon, 12 Dec 2022 04:14:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:subject:from:references:cc:to :content-language:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=lE6rZOS9ffH/Yk3dYNMYdk596yZemDJvPNi7MI+99fc=; b=wnBZ9r/FllzC/yJIVEmUOXCq7I6LwZdd5Ex+Yg26YM7CxqsSXw+gZgRZ1Xi7FNENuR 0FgQaF3p6nRRsH2/MICEle6LWXpGRSNI1/bxmgsZzpaGfAo3pih8Eyb86fBjyD/kqOBg JnW32jqoRTDMgLYWSlJOEFi6nMqZClp7Vmalunkq4yHVibfkpN4A5EXnTVuQ+f4q6E3s zAZZmR6XBBTBF8LS6AHwvx/+xWHtx9Zk4jwBzCXVyvuLM3rfLJldvVLYQEOe068YiUfz IlBDFuY5vwla4g2lmwyUeC4MVuDZs1p5MmDsjG5q77I+a3MWjIGq25UjqEJo26C0jB3A lmpQ== X-Gm-Message-State: ANoB5plh0DbbZgdmkz8bH6sUEyCr8lJYOIL05sC4OyAzCgDako0CLdod oMTBmiB1oOP0pCcr0umit8DnHtx4a2I= X-Received: by 2002:aa7:c614:0:b0:46c:ab70:c009 with SMTP id h20-20020aa7c614000000b0046cab70c009mr13965869edq.27.1670847273463; Mon, 12 Dec 2022 04:14:33 -0800 (PST) Received: from ?IPV6:2a0b:e7c0:0:107::aaaa:49? ([2a0b:e7c0:0:107::aaaa:49]) by smtp.gmail.com with ESMTPSA id s25-20020aa7d799000000b0045b910b0542sm3695122edq.15.2022.12.12.04.14.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Dec 2022 04:14:32 -0800 (PST) Message-ID: <320c939e-a3f0-1b1e-77e4-f3ecca00465d@kernel.org> Date: Mon, 12 Dec 2022 13:14:31 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Content-Language: en-US To: 'Tejun Heo' , David Laight Cc: Christoph Hellwig , "linux-kernel@vger.kernel.org" , Martin Liska , Josef Bacik , Jens Axboe , "cgroups@vger.kernel.org" , "linux-block@vger.kernel.org" References: <20221031114520.10518-1-jirislaby@kernel.org> <2b975ee3117e45aaa7882203cf9a4db8@AcuMS.aculab.com> From: Jiri Slaby Subject: Re: [PATCH] block/blk-iocost (gcc13): cast enum members to int in prints In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no 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 02. 11. 22, 17:43, 'Tejun Heo' wrote: > On Wed, Nov 02, 2022 at 06:27:46AM -1000, 'Tejun Heo' wrote: >> On Wed, Nov 02, 2022 at 08:35:34AM +0000, David Laight wrote: >>> I think the enums have to be split. >>> There will be other side effects of promoting the constants to 64bit >>> that are much more difficult to detect than the warnings from printf. >> >> idk, I think I can just add LLU to everything and it should be fine. >> >>> I'm also not sure whether the type is even consistent for 32bit >>> and 64bit builds. >>> Casts are (sort of) horrid. >> >> Yeah, I don't think casts are the solution either. Lemme add LLU to >> everything and see how it works. > > So adding LLU to initializers don't make the specific enum's type follow > suit. I guess type determination is really based on the value range. Oh man, > what a mess. > > If we end up having to split the enum defs, that's what we'll do but this > doesn't sense to me. It's one thing to make one time adjustment when we > adopt -std=g2x. That's fine, but it makes no sense for the compiler to > change type behavior underneath existing code bases in a way that prevents > the same code to mean the same thing in adjacent and recent compiler > versions. Even if gcc goes for that for whatever reason, there gotta be an > option to keep the original behavior, right? Unfortunately not, see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107405#c8 (linked also from the commit log). We'd use such an option if there were one. > If so, my suggestion is just sticking with the old behavior until we switch > to --std=g2x and then make one time adjustment at that point. So is the enum split OK under these circumstances? thanks, -- js suse labs