From 57b97b42bdecafd81c4967a10aef6eaf43d3fcb8 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 25 Feb 2018 21:13:38 -0500 Subject: add public interface headers to implementation files 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/stdlib/abs.c | 2 ++ src/stdlib/labs.c | 2 ++ src/stdlib/llabs.c | 2 ++ 3 files changed, 6 insertions(+) (limited to 'src/stdlib') diff --git a/src/stdlib/abs.c b/src/stdlib/abs.c index 4806d629..e721fdc2 100644 --- a/src/stdlib/abs.c +++ b/src/stdlib/abs.c @@ -1,3 +1,5 @@ +#include + int abs(int a) { return a>0 ? a : -a; diff --git a/src/stdlib/labs.c b/src/stdlib/labs.c index 675b95b8..83ddb147 100644 --- a/src/stdlib/labs.c +++ b/src/stdlib/labs.c @@ -1,3 +1,5 @@ +#include + long labs(long a) { return a>0 ? a : -a; diff --git a/src/stdlib/llabs.c b/src/stdlib/llabs.c index bec4a03d..9dfaf5cf 100644 --- a/src/stdlib/llabs.c +++ b/src/stdlib/llabs.c @@ -1,3 +1,5 @@ +#include + long long llabs(long long a) { return a>0 ? a : -a; -- cgit v1.2.1