Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp732515rwb; Thu, 19 Jan 2023 01:48:38 -0800 (PST) X-Google-Smtp-Source: AMrXdXv+nDwRRSLoO3xLJBX4sKdgaviS68GJjQULOQ8LF5hwCk0OXYbY5Qzpl5R73SaWlaMfbME4 X-Received: by 2002:a50:ee8d:0:b0:49e:4ea6:8054 with SMTP id f13-20020a50ee8d000000b0049e4ea68054mr5118949edr.3.1674121717981; Thu, 19 Jan 2023 01:48:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674121717; cv=none; d=google.com; s=arc-20160816; b=cKeJPuhiDwmvmSYw7bzbksOB/sRAXk8lHzZJi4a8rzIQchAT//9DUim4nKX8Gp9cnM h79Jlm+gTLzUN0VQ4S9vQia7UW11FkUTZ31NMaAJAYiExpu6FkQBOmie4wIf6jYGeeLE kGO3lu3pOGPZXhlSsJwLvpLQcloJ/Qed94H50HoT6WC9s1fI7P7gJ3qNznBf2bRSlHwF 2WGhOBY8Dvb46mb+bjGbuWhJ/MubnCNfvibi4vbnrtUdEHtOZEYTPUklQFL/sy1jAX6I xL1J2HnfvbwkI+t9XMQD8hBV5uyxKfOuw4RIt9tXGqwP/RhCW7bNMjopeMp6lQxFU5Q5 7tSw== 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=lPfC9OWlpX7fJdfuEuaXUmoOgJXyKno1evKtwr0uClg=; b=F1YBpZ3IdTOq8o0nc9zGVZwYVEeHaOrKYI891Lb5kaT6eb2O9U3zy9P0eEhwASQPAU eeUlDjdd/xV8SfvkKeIl1QHOhb/OQ+VY+7CPSo6MUIbkrPFtzfeBWtd9iJVEnoUpXnzT 2XjPKVjiIu4FqXX5L+RjihaavUKBtpncPwLO0/NxzvR6EapmxWFtjQIGeVAS4FlZGtp0 +kNq/Qbph5x+S13qmuD0Fsiwo3vgu0YtYVaRGP7FpOPrus9ZstV6nMaidGrQp74ILaib RV3LwpadKUsKLI4okgOQP2ZDeiU6fIXe9Khl4rhMopM8jrt9H5PgJzNBmERi1FsqwjH4 2rYg== 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 s24-20020a056402037800b00499c63cd389si24955637edw.442.2023.01.19.01.48.26; Thu, 19 Jan 2023 01:48:37 -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 S229682AbjASJVO convert rfc822-to-8bit (ORCPT + 44 others); Thu, 19 Jan 2023 04:21:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229606AbjASJVM (ORCPT ); Thu, 19 Jan 2023 04:21:12 -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 2507A5412A for ; Thu, 19 Jan 2023 01:21:10 -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-280-X0-dLLTkMYurBUVT-7NQTQ-1; Thu, 19 Jan 2023 09:21:07 +0000 X-MC-Unique: X0-dLLTkMYurBUVT-7NQTQ-1 Received: from AcuMS.Aculab.com (10.202.163.4) by AcuMS.aculab.com (10.202.163.4) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 19 Jan 2023 09:21:06 +0000 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.044; Thu, 19 Jan 2023 09:21:06 +0000 From: David Laight To: 'Tejun Heo' , Arnd Bergmann CC: Arnd Bergmann , Lai Jiangshan , Richard Clark , =?iso-8859-1?Q?Jonathan_Neusch=E4fer?= , "Andrey Grodzovsky" , Tetsuo Handa , "linux-kernel@vger.kernel.org," Subject: RE: [PATCH] workqueue: fix enum type for gcc-13 Thread-Topic: [PATCH] workqueue: fix enum type for gcc-13 Thread-Index: AQHZKpKFluEYnxF+H0aveYqsdFdjha6j5uGAgAESbYCAAH4KkA== Date: Thu, 19 Jan 2023 09:21:06 +0000 Message-ID: <0f84c480eb3c4972bbd34b45ddf258f2@AcuMS.aculab.com> References: <20230117164041.1207412-1-arnd@kernel.org> <99ea6e86d2594b40a6de96cc821c447b@AcuMS.aculab.com> 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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, 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 From: Tejun Heo > Sent: 19 January 2023 01:42 > > On Wed, Jan 18, 2023 at 09:32:45PM +0100, Arnd Bergmann wrote: > > the enum type has to be compatible with 'long long' because > > anything shorter would not fit both -1 and -1u (UINT_MAX). > > A and B were both signed types to match the signedness of the > > enum type, but A was actually a 32-bit integer since that is > > sufficient, while B was also a 64-bit type since it exceeds > > INT_MAX. Now they are both the same type. > > Yeah, the new behavior makes total sense. > > > I don't think there is a chance they will revert to the old behavior, > > though we could try asking for an command line flag to warn about > > cases where this changes code generation. > > but the way that it's transitioning doesn't really make sense to me. We do > phase out support for old compilers, so it isn't that difficult to manage > this transition smoothly - add a compat option in the new versions, switch > code later once old compilers are phased out and drop the compat flag. > > The way it's currently done causes situations which can't be handled > logically - we end up having to regroup enums based on their value range > rather than the logical type they need to be because there's no way to > override the enum type on older compilers. Didn't someone say that either C++ or C23 defines a syntax to explicitly set the type of the enum. IIRC gcc-13 doesn't support that. If gcc-13 supported explicit setting of the type and also generated a warn/error enum with 'large' values when the type wasn't specified (ie where the gcc extension had been used) then at least there would be no obscure surprises. Getting an old gcc to ignore the type is easy. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)