From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2602 invoked by alias); 27 Aug 2018 19:22:01 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 2487 invoked by uid 89); 27 Aug 2018 19:21:59 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 spammy= X-HELO: sessmg23.ericsson.net Received: from sessmg23.ericsson.net (HELO sessmg23.ericsson.net) (193.180.251.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 27 Aug 2018 19:21:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/simple; q=dns/txt; i=@ericsson.com; t=1535397715; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=X2VKQqLmrQUc1d0tTYm1A7GXYJAVUs4B28e88dHaGk8=; b=RCK422r/UWpuzKy55MmLCVlUyA8zb0dfNa0IA2UVbc7hMIKpvcSq01xzzwdWs1bH ymti0ugnowt04wZGMYc8aBb5xBF6IhfdBNixvd2/XA54/Wrj/yXdE1QxjoxNdlau jkv6FlrWOIIUlcXWO3ro2DJKR6ByWmWaLqw1llK8TLY=; Received: from ESESBMB504.ericsson.se (Unknown_Domain [153.88.183.117]) by sessmg23.ericsson.net (Symantec Mail Security) with SMTP id 44.86.22015.35F448B5; Mon, 27 Aug 2018 21:21:55 +0200 (CEST) Received: from ESESSMB504.ericsson.se (153.88.183.165) by ESESBMB504.ericsson.se (153.88.183.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Mon, 27 Aug 2018 21:21:55 +0200 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (153.88.183.157) by ESESSMB504.ericsson.se (153.88.183.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3 via Frontend Transport; Mon, 27 Aug 2018 21:21:55 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oRnqnFxzeV/KTRJ8lofELXfRBgWFFhCzLk7gmzogtN4=; b=Ja7m0UNNjKWwrd9yJEIkBYYVAQnvz1TdaRnYveZVqPz/6O9tcLp8wGIdFWuPAaXQabF6ZZJ6Yt/6k6lFkP5k1VZMOWIZ5UgTjZ/tRC+QAZBDgdkShlQEdEWt/tgnm49+RdSYtsrmWfG4IoNI9XcNbCpV1EXUJJGKK3vCLJjvhAA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=simon.marchi@ericsson.com; Received: from [142.133.48.188] (192.75.88.130) by SN6PR15MB2399.namprd15.prod.outlook.com (2603:10b6:805:24::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.15; Mon, 27 Aug 2018 19:21:53 +0000 Subject: Re: [PATCH 2/9] Use unsigned as base type for some enums To: Tom Tromey , References: <20180827145620.11055-1-tom@tromey.com> <20180827145620.11055-3-tom@tromey.com> From: Simon Marchi Message-ID: <86e5c223-9fcc-ad6c-7c29-63037f4bdb74@ericsson.com> Date: Mon, 27 Aug 2018 19:22:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180827145620.11055-3-tom@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-Path: simon.marchi@ericsson.com Received-SPF: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts) X-IsSubscribed: yes X-SW-Source: 2018-08/txt/msg00668.txt.bz2 On 2018-08-27 10:56 AM, Tom Tromey wrote: > -fsanitize=undefined complains about using operator~ on various enum > types that are used with DEF_ENUM_FLAGS_TYPE. This patch fixes these > problems by explicitly setting the base type for these enums to > unsigned. Can you give an example of how the error manifests itself (I'm not really familiar with -fsanitize=undefined). Is the error reported at compile-time or run-time? I'm not able to make a synthetic standalone example to reproduce the error. In any case, that LGTM if that makes the compiler happy. If the error reported by -fsanitize=undefined is at run-time, could we add a static assert in there to make sure the underlying types of types used with DEF_ENUM_FLAGS_TYPE are unsigned, to get a compilation error? Simon