Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1015124pxb; Wed, 6 Apr 2022 06:46:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYVColjq7uSYi3Naza7usFiw2B3kivosDzFwzkxaFMVfG64NgWq8mJ2ddbg5gmRLic41Ay X-Received: by 2002:a17:902:7c94:b0:14d:77d2:a72e with SMTP id y20-20020a1709027c9400b0014d77d2a72emr8837273pll.153.1649252785443; Wed, 06 Apr 2022 06:46:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649252785; cv=none; d=google.com; s=arc-20160816; b=Rl8wpb4yWsST2EfLB/dRMYz16W+blklQF7cvPMQV9wdp/5XheX1H3qoYt+TpwWHnUO QgBCdkMuFdIHs9NhcNldPdpTHLYRQwvJS1TNlK7yssBwlIt3tT1dAa185lYZG2JtRyQO 65kH0Z39f4UFOdbtoSV2su9pmJo3xu64lWHQwv1V47fmNpE77ZSbn2ZGso6FlhGWmblQ 0OSe1aKWAcP2ucF3vlQTaAVD1vmpXM4oeC9wfsOOFPp2oJJB4i89+xU3DqtqR4ovucKm HAhqIAChqjQj0JWsm6F0koa1yejr1maMxwwFl+4n+eNK8TYLW5m8/Dn6Z8nOH4G3I8Do htug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature:dkim-signature; bh=9a/4aWMnWgkY65Ue+vqroxBzn1D+3uaU5AzDsaTyLNk=; b=ZET7mWbwmq1aev8vLyOOLHiWe9MiFNVxOBebwG5KtBWKzGHqD161NuduxJOrhT1jPb +L9FPM7IqzD6pfz5FqvOw/Hbq/xWsL0p2+wFQIUU1HoSOreKIjrKM4W7p9dJdZIT6Vds x66hB5Q2FJBSQL6zETFP8NnYngw3qlIx724L3su00jty3ZE5/nzKaO/1lUyDafy/GiAd xwsFIQHYa51MHlSgbBtsZmQ+RPUvwqOC0pkH4TuMK23Cb1VX8od5Ot541lUB5afPXPaT l2BgE2CppfB5IyFj7tTn9msCS9mnw06DFyMca1oQmNdT8TDNf+h/pxMq5Xw6tZ+vworj f2ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=2Wea9AbD; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=KFhmiYSg; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id lp3-20020a17090b4a8300b001c69ee187d0si5257874pjb.171.2022.04.06.06.46.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 06:46:25 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=2Wea9AbD; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=KFhmiYSg; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 63F1639CBDC; Wed, 6 Apr 2022 04:41:33 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231136AbiDEXxk (ORCPT + 99 others); Tue, 5 Apr 2022 19:53:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354203AbiDEKMP (ORCPT ); Tue, 5 Apr 2022 06:12:15 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D06A53E2C; Tue, 5 Apr 2022 02:58:35 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id BE1411F745; Tue, 5 Apr 2022 09:58:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1649152713; 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=9a/4aWMnWgkY65Ue+vqroxBzn1D+3uaU5AzDsaTyLNk=; b=2Wea9AbDcGVfSFq0QG3rlJWkGO+m7CJ4DLAeyJSfPiKAbSa9IUttz9RwKzFsHbtpu7P086 PIwrqr+4xrLKni7Ee2uD8j4mfQqFgRuyq+fNoR0SCVO6Lz4tgH2+YvXgEDXeFs+7H8HbY4 oC4d/GeD4tyVud9VBdkNCNEYYIy7Tq4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1649152713; 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=9a/4aWMnWgkY65Ue+vqroxBzn1D+3uaU5AzDsaTyLNk=; b=KFhmiYSggNmD9D1VA7PMDbsQDcs7P8Xutg+p8/i9NhcXPmq3NfN4ykB1Ymc2mxyE0638a1 XEVmsUz7jSSQscDg== Received: from murzim.suse.de (murzim.suse.de [10.160.4.192]) (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 B7283A3B83; Tue, 5 Apr 2022 09:58:33 +0000 (UTC) Date: Tue, 5 Apr 2022 11:58:33 +0200 (CEST) From: Richard Biener To: Borislav Petkov cc: linux-toolchains@vger.kernel.org, Michael Matz , lkml Subject: Re: older gccs and case labels producing integer constants In-Reply-To: Message-ID: <7o5nn52-nqn1-oo13-s6o9-59r85r91o768@fhfr.qr> References: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="-1609908220-30019681-1649152713=:27745" X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE 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 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---1609908220-30019681-1649152713=:27745 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT On Tue, 5 Apr 2022, Borislav Petkov wrote: > Hi folks, > > I'm starting to see failures like this on allmodconfig builds: > > sound/usb/midi.c: In function ‘snd_usbmidi_out_endpoint_create’: > sound/usb/midi.c:1389:2: error: case label does not reduce to an integer constant > case (((0xfc08) << 16) | (0x0101)): > ^~~~ > > (The case statement is a macro but it evaluates to what I have there) > > and that thing fails with > > $ gcc --version > gcc (SUSE Linux) 7.5.0 > > although it doesn't have any problems building with newer compilers. > > I'm presuming older gccs consider those case statements signed ints and > the following fixes it: > > case ((((unsigned int)0xfc08) << 16) | (0x0101)): > > and I guess we can whack the couple of occurrences but what I'm > wondering is why does this work with newer gccs? I tried void foo (int i) { switch (i) { case (((0xfc08) << 16) | (0x0101)):; } } also with 'unsigned int i' but that's accepted with GCC 7. So what do you switch on? > Thx. > > -- Richard Biener SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany; GF: Ivo Totev; HRB 36809 (AG Nuernberg) ---1609908220-30019681-1649152713=:27745--