include header that declares __syscall_ret where it's defined
authorRich Felker <dalias@aerifal.cx>
Mon, 24 Mar 2014 00:42:05 +0000 (20:42 -0400)
committerRich Felker <dalias@aerifal.cx>
Mon, 24 Mar 2014 00:42:05 +0000 (20:42 -0400)
in general, we aim to always include the header that's declaring a
function before defining it so that the compiler can check that
prototypes match.

additionally, the internal syscall.h declares __syscall_ret with a
visibility attribute to improve code generation for shared libc (to
prevent gratuitous GOT-register loads). this declaration should be
visible at the point where __syscall_ret is defined, too, or the
inconsistency could theoretically lead to problems at link-time.

src/internal/syscall_ret.c

index d99f4a5090c948938f31f4d9a4ce0bff01ac53b5..a3f471368fc36ec6ebadbfe37f81ace83aaa4c7b 100644 (file)
@@ -1,4 +1,5 @@
 #include <errno.h>
+#include "syscall.h"
 
 long __syscall_ret(unsigned long r)
 {