public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r9-10087] libgomp: Don't include limits.h instead of hidden visibility block Date: Wed, 11 May 2022 06:21:13 +0000 (GMT) [thread overview] Message-ID: <20220511062113.D2E8A3838008@sourceware.org> (raw) https://gcc.gnu.org/g:120182aa1e6d21a830689175fd6ce0566b65ffeb commit r9-10087-g120182aa1e6d21a830689175fd6ce0566b65ffeb Author: Jakub Jelinek <jakub@redhat.com> Date: Tue Jul 13 09:50:49 2021 +0200 libgomp: Don't include limits.h instead of hidden visibility block sem.h is included in between # pragma GCC visibility push(hidden) and # pragma GCC visibility pop and includes limits.h there, which since the introduction of sysconf declaration in recent glibcs in there causes trouble. libgomp assumes it is compiled by gcc, so we don't really need to include limits.h there and can use -__INT_MAX__ - 1 instead (which clang and icc support too for years). 2021-07-13 Jakub Jelinek <jakub@redhat.com> Florian Weimer <fweimer@redhat.com> * config/linux/sem.h: Don't include limits.h. (SEM_WAIT): Define to -__INT_MAX__ - 1 instead of INT_MIN. * config/linux/affinity.c: Include limits.h. (cherry picked from commit 42f10ba5b57250506d69a0391ea7771c843ea286) Diff: --- libgomp/config/linux/affinity.c | 1 + libgomp/config/linux/sem.h | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/libgomp/config/linux/affinity.c b/libgomp/config/linux/affinity.c index 647d241b741..278101e31f2 100644 --- a/libgomp/config/linux/affinity.c +++ b/libgomp/config/linux/affinity.c @@ -35,6 +35,7 @@ #include <stdio.h> #include <string.h> #include <unistd.h> +#include <limits.h> #ifdef HAVE_PTHREAD_AFFINITY_NP diff --git a/libgomp/config/linux/sem.h b/libgomp/config/linux/sem.h index b9283955cd4..b0335c05de9 100644 --- a/libgomp/config/linux/sem.h +++ b/libgomp/config/linux/sem.h @@ -33,10 +33,8 @@ #ifndef GOMP_SEM_H #define GOMP_SEM_H 1 -#include <limits.h> /* For INT_MIN */ - typedef int gomp_sem_t; -#define SEM_WAIT INT_MIN +#define SEM_WAIT (-__INT_MAX__ - 1) #define SEM_INC 1 extern void gomp_sem_wait_slow (gomp_sem_t *, int);
reply other threads:[~2022-05-11 6:21 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220511062113.D2E8A3838008@sourceware.org \ --to=jakub@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).