* [PATCH] Turn implict-function-declaration warnings into errors
@ 2014-09-08 12:17 Florian Weimer
2014-09-09 21:06 ` Roland McGrath
2014-09-12 8:28 ` Stefan Liebler
0 siblings, 2 replies; 3+ messages in thread
From: Florian Weimer @ 2014-09-08 12:17 UTC (permalink / raw)
To: GNU C Library
[-- Attachment #1: Type: text/plain, Size: 388 bytes --]
GCC 4.4, the minimum compiler version, supports this option. Unlike
other warnings, -Wimplicit-function-declaration warnings should be
independent of compiler versions, so this change should not cause
compiler-specific build failures (the usual trouble with -Werror).
Testing this change revealed one missing #include file in a test case.
--
Florian Weimer / Red Hat Product Security
[-- Attachment #2: 0001-Turn-on-Werror-implicit-function-declaration.patch --]
[-- Type: text/x-patch, Size: 1664 bytes --]
From 842685f0c3f38d81474e809ff0b112099ed11e1c Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Mon, 8 Sep 2014 13:49:36 +0200
Subject: [PATCH 1/2] Turn on -Werror=implicit-function-declaration
GCC 4.4, the minimum compiler version, supports this option. Unlike
other warnings, -Wimplicit-function-declaration warnings should be
independent of compiler versions, so this change should not cause
compiler-specific build failures.
---
ChangeLog | 8 ++++++++
Makeconfig | 2 +-
stdlib/tst-tls-atexit-lib.c | 2 ++
3 files changed, 11 insertions(+), 1 deletion(-)
2014-09-08 Florian Weimer <fweimer@redhat.com>
* Makeconfig (gccwarn-c): Turn implicit-function-declaration
warnings into errors.
* stdlib/tst-tls-atexit-lib.c: Include <stdlib.h>, for the
__cxa_thread_atexit_impl prototype.
diff --git a/Makeconfig b/Makeconfig
index cef0f06..0f8069b 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -717,7 +717,7 @@ else
+gccwarn := -Wall -Wwrite-strings -Winline
endif
+gccwarn += -Wundef
-+gccwarn-c = -Wstrict-prototypes
++gccwarn-c = -Wstrict-prototypes -Werror=implicit-function-declaration
# We do not depend on the address of constants in different files to be
# actually different, so allow the compiler to merge them all.
diff --git a/stdlib/tst-tls-atexit-lib.c b/stdlib/tst-tls-atexit-lib.c
index 964f94b..b67d62f 100644
--- a/stdlib/tst-tls-atexit-lib.c
+++ b/stdlib/tst-tls-atexit-lib.c
@@ -16,6 +16,8 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <stdlib.h>
+
extern void *__dso_handle;
typedef struct
--
1.9.3
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Turn implict-function-declaration warnings into errors
2014-09-08 12:17 [PATCH] Turn implict-function-declaration warnings into errors Florian Weimer
@ 2014-09-09 21:06 ` Roland McGrath
2014-09-12 8:28 ` Stefan Liebler
1 sibling, 0 replies; 3+ messages in thread
From: Roland McGrath @ 2014-09-09 21:06 UTC (permalink / raw)
To: Florian Weimer; +Cc: GNU C Library
Seems fine.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Turn implict-function-declaration warnings into errors
2014-09-08 12:17 [PATCH] Turn implict-function-declaration warnings into errors Florian Weimer
2014-09-09 21:06 ` Roland McGrath
@ 2014-09-12 8:28 ` Stefan Liebler
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Liebler @ 2014-09-12 8:28 UTC (permalink / raw)
To: libc-alpha; +Cc: arnez, krebbel
Hi,
turning implicit-function-declaration warnings into errors leads to
build failure on 31bit s390 due to several usages of macro udiv_qrnnd
declared in file stdlib/longlong.h, e.g.:
"gcc elf-init.c ...
../sysdeps/wordsize-32/divdi3.c: In function '__udivmoddi4':
../sysdeps/wordsize-32/divdi3.c:82:4: error: implicit declaration of
function '__udiv_w_sdiv' [-Werror=implicit-function-declaration]
udiv_qrnnd (q0, n0, n1, n0, d0);
^
"
Andreas Krebbel had proposed a patch for fixing the warning/error on
glibc-list (https://sourceware.org/ml/libc-alpha/2014-01/msg00280.html),
which was then forwarded to gcc-list
(https://gcc.gnu.org/ml/gcc-patches/2014-02/msg00194.html), but without
any response.
I will ping on the gcc list. The stdlib/longlong.h file in glibc needs
to be updated from gcc source after commit in gcc.
Bye
Stefan
On 09/08/2014 02:17 PM, Florian Weimer wrote:
> GCC 4.4, the minimum compiler version, supports this option. Unlike
> other warnings, -Wimplicit-function-declaration warnings should be
> independent of compiler versions, so this change should not cause
> compiler-specific build failures (the usual trouble with -Werror).
>
> Testing this change revealed one missing #include file in a test case.
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-09-12 8:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-08 12:17 [PATCH] Turn implict-function-declaration warnings into errors Florian Weimer
2014-09-09 21:06 ` Roland McGrath
2014-09-12 8:28 ` Stefan Liebler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).