public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] libgomp: Fix build for -fshort-enums
@ 2023-05-22 12:51 Sebastian Huber
  2023-07-04  6:20 ` Sebastian Huber
  0 siblings, 1 reply; 4+ messages in thread
From: Sebastian Huber @ 2023-05-22 12:51 UTC (permalink / raw)
  To: gcc-patches

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
-- 
2.35.3


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] libgomp: Fix build for -fshort-enums
  2023-05-22 12:51 [PATCH] libgomp: Fix build for -fshort-enums Sebastian Huber
@ 2023-07-04  6:20 ` Sebastian Huber
  2023-09-11 12:57   ` Sebastian Huber
  0 siblings, 1 reply; 4+ messages in thread
From: Sebastian Huber @ 2023-07-04  6:20 UTC (permalink / raw)
  To: gcc-patches

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.

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] libgomp: Fix build for -fshort-enums
  2023-07-04  6:20 ` Sebastian Huber
@ 2023-09-11 12:57   ` Sebastian Huber
  2024-01-19  9:55     ` Sebastian Huber
  0 siblings, 1 reply; 4+ messages in thread
From: Sebastian Huber @ 2023-09-11 12:57 UTC (permalink / raw)
  To: gcc-patches

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.

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] libgomp: Fix build for -fshort-enums
  2023-09-11 12:57   ` Sebastian Huber
@ 2024-01-19  9:55     ` Sebastian Huber
  0 siblings, 0 replies; 4+ messages in thread
From: Sebastian Huber @ 2024-01-19  9:55 UTC (permalink / raw)
  To: gcc-patches

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?

-- 
embedded brains GmbH & Co. KG
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-01-19  9:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-22 12:51 [PATCH] libgomp: Fix build for -fshort-enums Sebastian Huber
2023-07-04  6:20 ` Sebastian Huber
2023-09-11 12:57   ` Sebastian Huber
2024-01-19  9:55     ` Sebastian Huber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).