summaryrefslogtreecommitdiff
path: root/arch/i386
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-10-13 23:46:51 -0400
committerRich Felker <dalias@aerifal.cx>2012-10-13 23:46:51 -0400
commit185a97707429aacfa1e8db62fc9fdb2188539d86 (patch)
tree65b08af59301fc7419eb5e1e9c93dd39ae737f79 /arch/i386
parente23d358fd6254d88c85750a23cd1234855c3292c (diff)
downloadmusl-185a97707429aacfa1e8db62fc9fdb2188539d86.tar.gz
ensure pointer decay in inline-asm arg for i386 syscall6
this is actually a rather subtle issue: do arrays decay to pointers when used as inline asm args? gcc says yes, but currently pcc says no. hopefully this discrepency in pcc will be fixed, but since the behavior is not clearly defined anywhere I can find, I'm using an explicit operation to cause the decay to occur.
Diffstat (limited to 'arch/i386')
-rw-r--r--arch/i386/syscall_arch.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/i386/syscall_arch.h b/arch/i386/syscall_arch.h
index 2d64b0b0..f2a81632 100644
--- a/arch/i386/syscall_arch.h
+++ b/arch/i386/syscall_arch.h
@@ -50,7 +50,7 @@ static inline long __syscall5(long n, long a1, long a2, long a3, long a4, long a
static inline long __syscall6(long n, long a1, long a2, long a3, long a4, long a5, long a6)
{
unsigned long __ret;
- __asm__ __volatile__ ("push %6 ; call __vsyscall6 ; add $4,%%esp" : "=a"(__ret) : "a"(n), "d"(a1), "c"(a2), "D"(a3), "S"(a4), "g"((long[]){a5, a6}) : "memory");
+ __asm__ __volatile__ ("push %6 ; call __vsyscall6 ; add $4,%%esp" : "=a"(__ret) : "a"(n), "d"(a1), "c"(a2), "D"(a3), "S"(a4), "g"(0+(long[]){a5, a6}) : "memory");
return __ret;
}