[LTP] [PATCH 4/4] libs: sigwait: Get rid of REPORT_SUCCESS() macro

Cyril Hrubis chrubis@suse.cz
Fri Jul 24 14:20:48 CEST 2020


Hi!
> > sigwait.c: In function ???test_masked_matching???:
> > sigwait.c:157:42: warning: passing argument 3 to restrict-qualified parameter aliases with argument 2 [-Wrestrict]
> >   157 |  TEST(sigprocmask(SIG_SETMASK, &oldmask, &oldmask));
> >       |                                ~~~~~~~~  ^~~~~~~~
> > ../../include/tst_test.h:266:13: note: in definition of macro ???TEST???
> >   266 |   TST_RET = SCALL; \
>  
> > IMHO we shouldn't use oldmask for src and dest.
> 
> And I am not really sure what the error says and why it is there.

I guess that new enough glibc has restrict keyword used on the
sigprocmask() pointer parameters, which basically means that compiler
can assume that for the lifetime of the pointer a piece of memory can be
accessed only via that pointer or pointers directly derived from it.

And passing the same pointer twice obviously violates that promise,
hence the warning.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list