From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 4/4] libs: sigwait: Get rid of REPORT_SUCCESS() macro
Date: Fri, 24 Jul 2020 14:20:48 +0200 [thread overview]
Message-ID: <20200724122048.GF9768@yuki.lan> (raw)
In-Reply-To: <20200724103454.ttaqxq3hzmth7gpr@vireshk-mac-ubuntu>
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
next prev parent reply other threads:[~2020-07-24 12:20 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-23 13:42 [LTP] [PATCH 1/4] libs: sigwait: Use SAFE_FORK() Viresh Kumar
2020-07-23 13:42 ` [LTP] [PATCH 2/4] libs: sigwait: Add SAFE_SIG*() macros Viresh Kumar
2020-07-24 5:51 ` Petr Vorel
2020-07-24 8:43 ` Cyril Hrubis
2020-07-23 13:42 ` [LTP] [PATCH 3/4] libs: sigwait: Remove alarm() from setup() and cleanup() Viresh Kumar
2020-07-24 5:52 ` Petr Vorel
2020-07-24 8:44 ` Cyril Hrubis
2020-07-23 13:42 ` [LTP] [PATCH 4/4] libs: sigwait: Get rid of REPORT_SUCCESS() macro Viresh Kumar
2020-07-24 5:58 ` Petr Vorel
2020-07-24 10:34 ` Viresh Kumar
2020-07-24 12:20 ` Cyril Hrubis [this message]
2020-07-24 13:37 ` Petr Vorel
2020-07-24 12:32 ` Cyril Hrubis
2020-07-24 13:35 ` Petr Vorel
2020-07-24 5:49 ` [LTP] [PATCH 1/4] libs: sigwait: Use SAFE_FORK() Petr Vorel
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=20200724122048.GF9768@yuki.lan \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.