Re: [PATCH 4/5] Stop using deprecated function sigsetmask()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 16, 2018 at 06:42:19PM +0200, Antonio Ospite wrote:
> sigsetmask() is deprecated, at least on recent glibc; stop using it to
> silence the following compiler warning:

> -----------------------------------------------------------------------
> system.h:40:2: warning: ‘sigsetmask’ is deprecated [-Wdeprecated-declarations]
>   sigsetmask(0);
>   ^~~~~~~~~~
> In file included from /usr/include/x86_64-linux-gnu/sys/param.h:28,
>                  from shell.h:52,
>                  from nodes.c:46:
> /usr/include/signal.h:173:12: note: declared here
>  extern int sigsetmask (int __mask) __THROW __attribute_deprecated__;
>             ^~~~~~~~~~
> -----------------------------------------------------------------------

> Using sigprocmask() and friends unconditionally should not be a problem,
> as commit e94a964 (eval: Add vfork support, 2018-05-19) also does it.

The git history starts (in 2005) after HAVE_SIGSETMASK was added, but I
expect it was done this way to save a few bytes in the executable. With
ProPolice, the effect may be a bit more since a local variable of type
sigset_t often contains an array and may cause functions to be compiled
with stack protection when they otherwise wouldn't (note that
sigclearmask() is inline).

Both FreeBSD and NetBSD simply changed the sigsetmask() call to a
sigprocmask() call very early on (1995-1996).

Personally, I think clean code that compiles without warnings is more
important than making the executable as small as possible, but the
maintainer may not agree.

-- 
Jilles Tjoelker



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux