From 234f186a7d70707c54aa68b0b37a0d7bbefe911e Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Sun, 23 Feb 2014 14:09:22 +0100 Subject: [PATCH] Ensure system call indices are valid expressions in libc syscall stubs. --- libc/include/sys/syscall.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libc/include/sys/syscall.h b/libc/include/sys/syscall.h index bc8ea75f..eb793988 100644 --- a/libc/include/sys/syscall.h +++ b/libc/include/sys/syscall.h @@ -59,6 +59,11 @@ /* Create a function that selects the right system call and jumps into the generic implementation of system calls. */ #define SYSCALL_FUNCTION(syscall_name, syscall_index) \ +__attribute__((unused)) \ +static void __verify_index_expression_##syscall_name(void) \ +{ \ + (void) syscall_index; \ +} \ __asm__("\n" \ ".pushsection .text\n" \ ".type " #syscall_name ", @function\n" \