mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Petr Hosek <phosek@chromium.org>
To: "musl@lists.openwall.com" <musl@lists.openwall.com>
Subject: [PATCH] don't wrap __syscall invocation in parenthesis
Date: Fri, 06 Nov 2015 23:51:21 +0000	[thread overview]
Message-ID: <CABBv4TY4p8XeNUqNrkJRsjUUSVB1xceYb4OTn5Hh54JMWEB=KA@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 209 bytes --]

This is a cleanup change, when __syscall is defined as a macro, its
expansion breaks in cases where the invocation is wrapped in parenthesis.
There are 2 such cases in the codebase and this patch fixes those.

[-- Attachment #1.2: Type: text/html, Size: 233 bytes --]

[-- Attachment #2: don-t-wrap-__syscall-invocation-in-parenthesis.patch --]
[-- Type: text/x-patch, Size: 1362 bytes --]

From 21864f367028899b541290258711750313e226f5 Mon Sep 17 00:00:00 2001
From: Petr Hosek <phosek@chromium.org>
Date: Thu, 5 Nov 2015 07:57:23 -0800
Subject: [PATCH] don't wrap __syscall invocation in parenthesis

when __syscall is defined as a macro, its expansion breaks in
cases where the invocation is wrapped in parenthesis.
---
 src/fcntl/posix_fadvise.c | 2 +-
 src/thread/__syscall_cp.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/fcntl/posix_fadvise.c b/src/fcntl/posix_fadvise.c
index d5360e0..fc1562e 100644
--- a/src/fcntl/posix_fadvise.c
+++ b/src/fcntl/posix_fadvise.c
@@ -4,7 +4,7 @@
 
 int posix_fadvise(int fd, off_t base, off_t len, int advice)
 {
-	return -(__syscall)(SYS_fadvise, fd, __SYSCALL_LL_O(base),
+	return -__syscall(SYS_fadvise, fd, __SYSCALL_LL_O(base),
 		__SYSCALL_LL_E(len), advice);
 }
 
diff --git a/src/thread/__syscall_cp.c b/src/thread/__syscall_cp.c
index faf57b1..09878c6 100644
--- a/src/thread/__syscall_cp.c
+++ b/src/thread/__syscall_cp.c
@@ -10,7 +10,7 @@ static long sccp(syscall_arg_t nr,
                  syscall_arg_t u, syscall_arg_t v, syscall_arg_t w,
                  syscall_arg_t x, syscall_arg_t y, syscall_arg_t z)
 {
-	return (__syscall)(nr, u, v, w, x, y, z);
+	return __syscall(nr, u, v, w, x, y, z);
 }
 
 weak_alias(sccp, __syscall_cp_c);
-- 
2.6.0.rc2.230.g3dd15c0


             reply	other threads:[~2015-11-06 23:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-06 23:51 Petr Hosek [this message]
2015-11-07 13:29 ` Szabolcs Nagy
2015-11-08  0:51   ` Rich Felker

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='CABBv4TY4p8XeNUqNrkJRsjUUSVB1xceYb4OTn5Hh54JMWEB=KA@mail.gmail.com' \
    --to=phosek@chromium.org \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).