OSDN Git Service

add public interface headers to implementation files
authorRich Felker <dalias@aerifal.cx>
Mon, 26 Feb 2018 02:13:38 +0000 (21:13 -0500)
committerRich Felker <dalias@aerifal.cx>
Mon, 26 Feb 2018 02:17:48 +0000 (21:17 -0500)
general policy is that all source files defining a public API or an
ABI mechanism referenced by a public header should include the public
header that declares the interface, so that the compiler or analysis
tools can check the consistency of the declarations. Alexander Monakov
pointed out a number of violations of this principle a few years back.
fix them now.

src/errno/__errno_location.c
src/misc/gethostid.c
src/signal/sigrtmin.c
src/stdlib/abs.c
src/stdlib/labs.c
src/stdlib/llabs.c

index 7172a1b..ad9f924 100644 (file)
@@ -1,3 +1,4 @@
+#include <errno.h>
 #include "pthread_impl.h"
 
 int *__errno_location(void)
index ea65611..25bb35d 100644 (file)
@@ -1,3 +1,5 @@
+#include <unistd.h>
+
 long gethostid()
 {
        return 0;
index d0e769b..c5a1fd9 100644 (file)
@@ -1,3 +1,5 @@
+#include <signal.h>
+
 int __libc_current_sigrtmin()
 {
        return 35;
index 4806d62..e721fdc 100644 (file)
@@ -1,3 +1,5 @@
+#include <stdlib.h>
+
 int abs(int a)
 {
        return a>0 ? a : -a;
index 675b95b..83ddb14 100644 (file)
@@ -1,3 +1,5 @@
+#include <stdlib.h>
+
 long labs(long a)
 {
        return a>0 ? a : -a;
index bec4a03..9dfaf5c 100644 (file)
@@ -1,3 +1,5 @@
+#include <stdlib.h>
+
 long long llabs(long long a)
 {
        return a>0 ? a : -a;