* Proper warning silencing patch for Clang
@ 2017-06-09 14:10 Dmitry Golovin
2017-06-23 19:46 ` Rich Felker
0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Golovin @ 2017-06-09 14:10 UTC (permalink / raw)
To: musl
[-- Attachment #1: Type: text/plain, Size: 350 bytes --]
Hi!
This time the patch doesn't break anything. Check for supported optimizations is performed using "-Werror=ignored-optimization-argument" (clang specific) and also "-Qunused-arguments" is added to silence unused argument warnings (ignoring unused arguments is default behavior for GCC, but not for Clang).
The patch is attached.
Regards,
Dmitry
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-add-proper-check-for-clang-supported-optimization-an.patch --]
[-- Type: text/x-diff; name="0001-add-proper-check-for-clang-supported-optimization-an.patch", Size: 1245 bytes --]
From c37efc541b12d8e216b7a425808e4c24c48f9213 Mon Sep 17 00:00:00 2001
From: Dmitry Golovin <dima@golovin.in>
Date: Fri, 9 Jun 2017 16:41:53 +0300
Subject: [PATCH] add proper check for clang supported optimization and stop
complaining about unused arguements
---
configure | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/configure b/configure
index c2db298..539c9fc 100755
--- a/configure
+++ b/configure
@@ -249,6 +249,7 @@ fi
#
tryflag CFLAGS_TRY -Werror=unknown-warning-option
tryflag CFLAGS_TRY -Werror=unused-command-line-argument
+tryflag CFLAGS_TRY -Werror=ignored-optimization-argument
tryldflag LDFLAGS_TRY -Werror=unknown-warning-option
tryldflag LDFLAGS_TRY -Werror=unused-command-line-argument
@@ -504,6 +505,13 @@ tryflag CFLAGS_AUTO -Werror=implicit-int
tryflag CFLAGS_AUTO -Werror=pointer-sign
tryflag CFLAGS_AUTO -Werror=pointer-arith
+#
+# GCC ignores unused arguements by default, but Clang needs this extra
+# parameter to stop printing warnings about LDFLAGS passed during
+# compiling stage and CFLAGS passed during linking stage.
+#
+tryflag CFLAGS_AUTO -Qunused-arguments
+
if test "x$warnings" = xyes ; then
tryflag CFLAGS_AUTO -Wall
tryflag CFLAGS_AUTO -Wno-parentheses
--
2.13.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Proper warning silencing patch for Clang
2017-06-09 14:10 Proper warning silencing patch for Clang Dmitry Golovin
@ 2017-06-23 19:46 ` Rich Felker
0 siblings, 0 replies; 2+ messages in thread
From: Rich Felker @ 2017-06-23 19:46 UTC (permalink / raw)
To: musl
On Fri, Jun 09, 2017 at 05:10:47PM +0300, Dmitry Golovin wrote:
> Hi!
>
> This time the patch doesn't break anything. Check for supported
> optimizations is performed using
> "-Werror=ignored-optimization-argument" (clang specific) and also
> "-Qunused-arguments" is added to silence unused argument warnings
> (ignoring unused arguments is default behavior for GCC, but not for
> Clang).
>
> The patch is attached.
>
> Regards,
> Dmitry
OK, works fine for me. Committing. I just adjusted the commit message
to fit in ~72 columns.
Rich
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-06-23 19:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-09 14:10 Proper warning silencing patch for Clang Dmitry Golovin
2017-06-23 19:46 ` Rich Felker
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
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 NNTP newsgroup(s).