Message ID | 20181121034504.eheaeyautxx7k4e3@gondor.apana.org.au (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Herbert Xu |
Headers | show |
Series | [v2] system: Disable glibc warning on sigsetmask | expand |
On Wed, 21 Nov 2018 11:45:04 +0800 Herbert Xu <herbert@gondor.apana.org.au> wrote: > On Tue, Nov 20, 2018 at 11:48:20PM +0100, Antonio Ospite wrote: > > > > Just for the record, compiling with clang (CC=clang ./configure && make) > > still gives a warning: > > OK, we could disable it completely unless it's gcc: > That works with clang. > ---8<--- > As sigsetmask is set as deprecated in glibc this patch adds the > pragmas to disable the warning in gcc around our one and only use > of sigsetmask. > > It also disables it completely for non-gcc compilers and older > gcc compilers as they may generate a warning too. > The "it" in the last sentence may look like it refers to the warning while AFAIU it refers to the function call itself. So maybe say "It also disables sigsetmask() completely ..."? Also a brief note in the commit message about _why_ sigsetmask() is kept around when using gcc would be useful IMHO. Thank you, Antonio > Reported-by: Antonio Ospite <ao2@ao2.it> > Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> > > diff --git a/src/system.h b/src/system.h > index a8d09b3..007952c 100644 > --- a/src/system.h > +++ b/src/system.h > @@ -36,8 +36,17 @@ > > static inline void sigclearmask(void) > { > -#ifdef HAVE_SIGSETMASK > +#if defined(HAVE_SIGSETMASK) && \ > + (!defined(__GLIBC__) || \ > + (defined(__GNUC__) && (__GNUC__ * 1000 + __GNUC_MINOR__) >= 4006)) > +#ifdef __GLIBC__ > +#pragma GCC diagnostic push > +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" > +#endif > sigsetmask(0); > +#ifdef __GLIBC__ > +#pragma GCC diagnostic pop > +#endif > #else > sigset_t set; > sigemptyset(&set); > -- > Email: Herbert Xu <herbert@gondor.apana.org.au> > Home Page: http://gondor.apana.org.au/~herbert/ > PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
On Wed, 21 Nov 2018 11:37:05 +0100 Antonio Ospite <ao2@ao2.it> wrote: > On Wed, 21 Nov 2018 11:45:04 +0800 > Herbert Xu <herbert@gondor.apana.org.au> wrote: > [...] > > ---8<--- > > As sigsetmask is set as deprecated in glibc this patch adds the > > pragmas to disable the warning in gcc around our one and only use > > of sigsetmask. > > > > It also disables it completely for non-gcc compilers and older > > gcc compilers as they may generate a warning too. > > > [...] > Also a brief note in the commit message about _why_ sigsetmask() is > kept around when using gcc would be useful IMHO. > Hi, I see that this has been applied as well, along with the other patches, so gcc builds without warnings now, which is great, thank you. I am still a bit curious about why you decided to keep sigsetmask() around at all, tho, if you had a minute to explain your decision I would be interested. Ciao, Antonio
diff --git a/src/system.h b/src/system.h index a8d09b3..007952c 100644 --- a/src/system.h +++ b/src/system.h @@ -36,8 +36,17 @@ static inline void sigclearmask(void) { -#ifdef HAVE_SIGSETMASK +#if defined(HAVE_SIGSETMASK) && \ + (!defined(__GLIBC__) || \ + (defined(__GNUC__) && (__GNUC__ * 1000 + __GNUC_MINOR__) >= 4006)) +#ifdef __GLIBC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif sigsetmask(0); +#ifdef __GLIBC__ +#pragma GCC diagnostic pop +#endif #else sigset_t set; sigemptyset(&set);