Message ID | 20230522125149.30467-1-sebastian.huber@embedded-brains.de |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1423759vqo; Mon, 22 May 2023 05:52:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Nq/Snlg6LZrW5QFO5+iXvzdHxiOoEIeIh7Zf2I0DDFfO1++mR+zkCSKlwVM8NOvaklDn+ X-Received: by 2002:a17:907:971f:b0:96a:ec5c:687b with SMTP id jg31-20020a170907971f00b0096aec5c687bmr9990902ejc.64.1684759946672; Mon, 22 May 2023 05:52:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684759946; cv=none; d=google.com; s=arc-20160816; b=joflm9+naB3sERMLJwiFzrBltAC1rtUMWCTCHvngPH6ZrN0JRQidjFtnbTr4RajMcZ DIMUlKNcxImp0SIjU+hShM6ImbgLfwtOKPEa5k0t1KLQ2U2t7YrgOr5Yay2sqpPyYlXM Vtl/fpCYLsjvqRP2MOTGXHgKLVn0ytjfoz8C6O8WkVENaLtsvactaHYwoEwDd3HwVcsT 6SiIst/OtVFg7hAEg96k8/fqJXeeH4JTjZMvrWG+CWv9ZnkPHNzPM16VEIh1uXuUpxBA pzg1GP6uG4/jxNnW8G/sn82yJzmXz0QCxXtaKndjcGx8Hl9dBBQSWjKMLcrbZQNQnt/t FZXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dmarc-filter :delivered-to; bh=Sz9qw9gyb3ClRWx2jA6DjsIcNzb/5YrtxOsn8Bxjsh4=; b=scZQ4YCPzxH4kM3kgCSqGvi49vq3CnMkflxUVOZKn5sxIsS5MS13WcOj9Rhb3o7FDG Zm0UbNMIW7dWnAOKbiafOIr2bSZjb+IqHRwvaaGdlEnVlpDHFKNHKWB2eW9e414TdsXJ VvjC9DG1gqt6KwsdlbL68hO9oPzk0dJAl4BYFgVwpcl4ijLLyiQFOyRJ0PlcR03QaSsA wMqInC7ZieTK0WY8sLlyB8dNIwxRe2f9gjOPTPNsbrJ7fCLY2zddPQ4+WnwEYT4KONcS wORisNAyMoTeSwFyPEIIYu4Shsvw3RvhU8uTNGJ4azyQlvRBpBMuqL0ksarLasC+BTPz EfLQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id i18-20020a170906445200b00965cd166fb9si3523068ejp.96.2023.05.22.05.52.26 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 May 2023 05:52:26 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2E1613858431 for <ouuuleilei@gmail.com>; Mon, 22 May 2023 12:52:19 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from dedi548.your-server.de (dedi548.your-server.de [85.10.215.148]) by sourceware.org (Postfix) with ESMTPS id 03C983858D35 for <gcc-patches@gcc.gnu.org>; Mon, 22 May 2023 12:51:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 03C983858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embedded-brains.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embedded-brains.de Received: from sslproxy02.your-server.de ([78.47.166.47]) by dedi548.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from <sebastian.huber@embedded-brains.de>) id 1q150z-000Ob5-Ic for gcc-patches@gcc.gnu.org; Mon, 22 May 2023 14:51:53 +0200 Received: from [82.100.198.138] (helo=mail.embedded-brains.de) by sslproxy02.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <sebastian.huber@embedded-brains.de>) id 1q150z-0001he-6o for gcc-patches@gcc.gnu.org; Mon, 22 May 2023 14:51:53 +0200 Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id D22B9480041 for <gcc-patches@gcc.gnu.org>; Mon, 22 May 2023 14:51:52 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id ISxKver242v4 for <gcc-patches@gcc.gnu.org>; Mon, 22 May 2023 14:51:52 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 8636048016F for <gcc-patches@gcc.gnu.org>; Mon, 22 May 2023 14:51:52 +0200 (CEST) X-Virus-Scanned: amavisd-new at zimbra.eb.localhost Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id zrM70TOuiU-U for <gcc-patches@gcc.gnu.org>; Mon, 22 May 2023 14:51:52 +0200 (CEST) Received: from zimbra.eb.localhost (unknown [192.168.96.242]) by mail.embedded-brains.de (Postfix) with ESMTPSA id 714A0480041 for <gcc-patches@gcc.gnu.org>; Mon, 22 May 2023 14:51:52 +0200 (CEST) From: Sebastian Huber <sebastian.huber@embedded-brains.de> To: gcc-patches@gcc.gnu.org Subject: [PATCH] libgomp: Fix build for -fshort-enums Date: Mon, 22 May 2023 14:51:49 +0200 Message-Id: <20230522125149.30467-1-sebastian.huber@embedded-brains.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Authenticated-Sender: smtp-embedded@poldi-networks.de X-Virus-Scanned: Clear (ClamAV 0.103.8/26915/Mon May 22 09:23:18 2023) X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766598845629191591?= X-GMAIL-MSGID: =?utf-8?q?1766598845629191591?= |
Series |
libgomp: Fix build for -fshort-enums
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Sebastian Huber
May 22, 2023, 12:51 p.m. UTC
Make sure that the API enums have at least the size of int. Otherwise the following build error may occur: In file included from gcc/libgomp/env.c:34: ./libgomp_f.h: In function 'omp_check_defines': ./libgomp_f.h:77:8: error: size of array 'test' is negative 77 | char test[(28 != sizeof (omp_lock_t) | ^~~~ libgomp/ChangeLog: * omp.h.in (omp_alloctrait_key_t): Add __omp_alloctrait_key_t_max__ with a value of the int type maximum. --- libgomp/omp.h.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Comments
On 22.05.23 14:51, Sebastian Huber wrote: > Make sure that the API enums have at least the size of int. Otherwise the > following build error may occur: > > In file included from gcc/libgomp/env.c:34: > ./libgomp_f.h: In function 'omp_check_defines': > ./libgomp_f.h:77:8: error: size of array 'test' is negative > 77 | char test[(28 != sizeof (omp_lock_t) > | ^~~~ > > libgomp/ChangeLog: > > * omp.h.in (omp_alloctrait_key_t): Add __omp_alloctrait_key_t_max__ > with a value of the int type maximum. > --- > libgomp/omp.h.in | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/libgomp/omp.h.in b/libgomp/omp.h.in > index bd1286c2a3f..3b1612fcb15 100644 > --- a/libgomp/omp.h.in > +++ b/libgomp/omp.h.in > @@ -146,7 +146,8 @@ typedef enum omp_alloctrait_key_t > omp_atk_fallback = 5, > omp_atk_fb_data = 6, > omp_atk_pinned = 7, > - omp_atk_partition = 8 > + omp_atk_partition = 8, > + __omp_alloctrait_key_t_max__ = __INT_MAX__ > } omp_alloctrait_key_t; > > typedef enum omp_alloctrait_value_t Could someone please have a look at this.
On 04.07.23 08:20, Sebastian Huber wrote: > On 22.05.23 14:51, Sebastian Huber wrote: >> Make sure that the API enums have at least the size of int. Otherwise >> the >> following build error may occur: >> >> In file included from gcc/libgomp/env.c:34: >> ./libgomp_f.h: In function 'omp_check_defines': >> ./libgomp_f.h:77:8: error: size of array 'test' is negative >> 77 | char test[(28 != sizeof (omp_lock_t) >> | ^~~~ >> >> libgomp/ChangeLog: >> >> * omp.h.in (omp_alloctrait_key_t): Add __omp_alloctrait_key_t_max__ >> with a value of the int type maximum. >> --- >> libgomp/omp.h.in | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/libgomp/omp.h.in b/libgomp/omp.h.in >> index bd1286c2a3f..3b1612fcb15 100644 >> --- a/libgomp/omp.h.in >> +++ b/libgomp/omp.h.in >> @@ -146,7 +146,8 @@ typedef enum omp_alloctrait_key_t >> omp_atk_fallback = 5, >> omp_atk_fb_data = 6, >> omp_atk_pinned = 7, >> - omp_atk_partition = 8 >> + omp_atk_partition = 8, >> + __omp_alloctrait_key_t_max__ = __INT_MAX__ >> } omp_alloctrait_key_t; >> typedef enum omp_alloctrait_value_t > > Could someone please have a look at this. Ping.
On 11.09.23 14:57, Sebastian Huber wrote: > On 04.07.23 08:20, Sebastian Huber wrote: >> On 22.05.23 14:51, Sebastian Huber wrote: >>> Make sure that the API enums have at least the size of int. >>> Otherwise the >>> following build error may occur: >>> >>> In file included from gcc/libgomp/env.c:34: >>> ./libgomp_f.h: In function 'omp_check_defines': >>> ./libgomp_f.h:77:8: error: size of array 'test' is negative >>> 77 | char test[(28 != sizeof (omp_lock_t) >>> | ^~~~ >>> >>> libgomp/ChangeLog: >>> >>> * omp.h.in (omp_alloctrait_key_t): Add __omp_alloctrait_key_t_max__ >>> with a value of the int type maximum. >>> --- >>> libgomp/omp.h.in | 3 ++- >>> 1 file changed, 2 insertions(+), 1 deletion(-) >>> >>> diff --git a/libgomp/omp.h.in b/libgomp/omp.h.in >>> index bd1286c2a3f..3b1612fcb15 100644 >>> --- a/libgomp/omp.h.in >>> +++ b/libgomp/omp.h.in >>> @@ -146,7 +146,8 @@ typedef enum omp_alloctrait_key_t >>> omp_atk_fallback = 5, >>> omp_atk_fb_data = 6, >>> omp_atk_pinned = 7, >>> - omp_atk_partition = 8 >>> + omp_atk_partition = 8, >>> + __omp_alloctrait_key_t_max__ = __INT_MAX__ >>> } omp_alloctrait_key_t; >>> typedef enum omp_alloctrait_value_t >> >> Could someone please have a look at this. > > Ping. Any chance to get this integrated for GCC 14?
diff --git a/libgomp/omp.h.in b/libgomp/omp.h.in index bd1286c2a3f..3b1612fcb15 100644 --- a/libgomp/omp.h.in +++ b/libgomp/omp.h.in @@ -146,7 +146,8 @@ typedef enum omp_alloctrait_key_t omp_atk_fallback = 5, omp_atk_fb_data = 6, omp_atk_pinned = 7, - omp_atk_partition = 8 + omp_atk_partition = 8, + __omp_alloctrait_key_t_max__ = __INT_MAX__ } omp_alloctrait_key_t; typedef enum omp_alloctrait_value_t