Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8022210rwb; Tue, 13 Dec 2022 00:42:48 -0800 (PST) X-Google-Smtp-Source: AA0mqf6cuNSnSRNwK33QaXUMQvBaveIkDs9BAG3+bAFl0CLDMgsUDoLEmnMgKQrpW5xuYs8lgdLM X-Received: by 2002:a05:6a21:3a44:b0:9d:efbe:2082 with SMTP id zu4-20020a056a213a4400b0009defbe2082mr26308524pzb.56.1670920968717; Tue, 13 Dec 2022 00:42:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670920968; cv=none; d=google.com; s=arc-20160816; b=ZCh/DDdzgumaAyqtvAm1dkZIlyoLI/OEOpCiOB0YPjK1+mqx3RVtwC1DsfCq0Yrwgz 3GZdYPiGoe9pJ/G5+DBaQ7OEGbD2FraW/Ec2SvAcczUZciCol8cjrrAAn74mDif5GBqw 0n8DePLrkwy83HXe8x/15zCEI8CbOuqR6SKpwndqsA9fwJ0FPMgEZ3M9N6j5W+0fzkrO +c1vplah5P9KEzOr7Q0dqDzaHti3VPhYJi4IiGNJqtm1m/Afy6WxW/VJciZrs6tZC+q+ W0xOMoxlR4Ik0fYgZ1F9hFnsHwyKB0TPxEAXqzwRjInDEiA63PVkt8iJMYTWiuigA1Da clfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=QY5U8lgj7G4kAW3yXiJNlq/BueAKr19NWYpf9rZXmdg=; b=H3QIX5Xemgs8o2gROMQwAPA1figjRC/Zt/duTwoh/KuLj10HKueIBzbwrM5dS6Opv2 aZvgovXERYsKKxFq8w8fHvjRyqa9dZKtJ7diugjjhfZiffKGC5pmzKa5qmrL8/9RhLlk 4xXz6DUEQCmm120YGnSq30zpeebXQTDyh0GD3QyACf2oMEK0VlLeYRXlOn0SPTZhugVj 8DrtVDmQ0N602fk2eG4unf9cUO0ejeZnIVU7kb4JcPg0BOpSEHZOvydh2WEpg7+HYeIT nYdKv5LQ7d7hu7Zg93lpyOxIzB79UPn6SSuTj08Rcg16S4s6i/eVdkMA/eEKbKxB9B+N 29gA== 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=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h9-20020a056a001a4900b0056c07a694dasi11921412pfv.158.2022.12.13.00.42.39; Tue, 13 Dec 2022 00:42:48 -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=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234027AbiLMIbm convert rfc822-to-8bit (ORCPT + 75 others); Tue, 13 Dec 2022 03:31:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234770AbiLMIbJ (ORCPT ); Tue, 13 Dec 2022 03:31:09 -0500 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.85.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E5C21A80D for ; Tue, 13 Dec 2022 00:30:12 -0800 (PST) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-310-7JytmWPuMGiigtX7_hd_5g-1; Tue, 13 Dec 2022 08:30:09 +0000 X-MC-Unique: 7JytmWPuMGiigtX7_hd_5g-1 Received: from AcuMS.Aculab.com (10.202.163.6) by AcuMS.aculab.com (10.202.163.6) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Tue, 13 Dec 2022 08:30:08 +0000 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.044; Tue, 13 Dec 2022 08:30:08 +0000 From: David Laight To: 'Tejun Heo' , Jiri Slaby CC: Christoph Hellwig , "linux-kernel@vger.kernel.org" , Martin Liska , Josef Bacik , Jens Axboe , "cgroups@vger.kernel.org" , "linux-block@vger.kernel.org" Subject: RE: [PATCH] block/blk-iocost (gcc13): cast enum members to int in prints Thread-Topic: [PATCH] block/blk-iocost (gcc13): cast enum members to int in prints Thread-Index: AQHY7hGH734dfSyX20WOi86L/FtKtq4rTpIAgD+71dKAALHkcA== Date: Tue, 13 Dec 2022 08:30:08 +0000 Message-ID: References: <20221031114520.10518-1-jirislaby@kernel.org> <2b975ee3117e45aaa7882203cf9a4db8@AcuMS.aculab.com> <320c939e-a3f0-1b1e-77e4-f3ecca00465d@kernel.org> In-Reply-To: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,PDS_BAD_THREAD_QP_64, RCVD_IN_DNSWL_NONE,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 From: Tejun Heo On Behalf Of 'Tejun Heo' > Sent: 12 December 2022 21:47 > To: Jiri Slaby > Cc: David Laight ; Christoph Hellwig ; linux- > kernel@vger.kernel.org; Martin Liska ; Josef Bacik ; Jens Axboe > ; cgroups@vger.kernel.org; linux-block@vger.kernel.org > Subject: Re: [PATCH] block/blk-iocost (gcc13): cast enum members to int in prints > > On Mon, Dec 12, 2022 at 01:14:31PM +0100, Jiri Slaby wrote: > > > 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? > > Oh man, it's kinda crazy that the compiler is changing in a way that the > same piece of code can't be compiled the same way across two adjoining > versions of the same compiler. But, yeah, if that's what gcc is gonna do and > splitting enums is the only way to be okay across the compiler versions, > there isn't any other choice we can make. It is also a silent code-breaker. Compile this for 32bit x86: enum { a = 1, b = ~0ull}; extern int foo(int, ...); int f(void) { return foo(0, a, 2); } gcc13 pushes an extra zero onto the stack between the 1 and 2. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)