[llvm-bugs] [Bug 38772] New: Please remove: warning: argument unused during compilation: '-pthread'

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Aug 30 04:35:16 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=38772

            Bug ID: 38772
           Summary: Please remove: warning: argument unused during
                    compilation: '-pthread'
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: timj at gnu.org
                CC: llvm-bugs at lists.llvm.org

Please remove the following warning entirely from clang:

  clang: warning: argument unused during compilation: '-pthread'
[-Wunused-command-line-argument]

There is no scenario in which this warning provides a benefit for the user
(which is why other compilers don't have it), but this warning is a huge time
waster for everyone who pays attention to clang warnings or who compiles with
-Werror.
Even if CFLAGS and CXXFLAGS are carefully edited to avoid -pthread despite
pkg-config and other tools adding -pthread, and even if
-Wno-unused-command-line-argument is used, clang still complains, e.g. in
combination with libtool. It's just not possible to avoid this warning under
linux using the auto* toolchain.
See also #7798.

Here's just one example (clang-5.0) out of thousands of projects that trigger
this warning (note the explicit -Wno-unused-command-line-argument passed into
libtool):

$ rm -f cxxplugins.FPU.la && make V=1
Making all in .
make[1]: Entering directory '/opt/src/beast/plugins'
/bin/bash ../libtool  --tag=CXX   --mode=link clang++-5.0 -std=gnu++14 -Wall
-Wdeprecated -Werror=format-security -Wredundant-decls -Wpointer-arith
-Wmissing-declarations -Werror-implicit-function-declaration
-Werror=incompatible-pointer-types -Wsign-promo -Woverloaded-virtual -pipe -O3
-funroll-loops -ftree-vectorize -fno-strict-overflow -fno-strict-aliasing
-Wno-tautological-compare -Wno-constant-logical-operand
-Wno-unused-command-line-argument -minline-all-stringops -mmmx -msse -msse2
-msse3 -mcx16 -DG_ENABLE_DEBUG -g -pthread -I/usr/include/alsa
-I/usr/include/libgnomecanvas-2.0 -I/usr/include/gail-1.0
-I/usr/include/libart-2.0 -I/usr/include/gtk-2.0
-I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/
-I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0
-I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng16
-I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/pango-1.0
-I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2
-D_REENTRANT  -DBSE_CONVENIENCE -Wall -Wdeprecated -Werror=format-security
-Wredundant-decls -Wpointer-arith -Wmissing-declarations
-Werror-implicit-function-declaration -Werror=incompatible-pointer-types
-Wsign-promo -Woverloaded-virtual -pipe -O3 -funroll-loops -ftree-vectorize
-fno-strict-overflow -fno-strict-aliasing -Wno-tautological-compare
-Wno-constant-logical-operand -Wno-unused-command-line-argument
-minline-all-stringops -mmmx -msse -msse2 -msse3 -mcx16 -DG_ENABLE_DEBUG -g
-pthread -I/usr/include/alsa -I/usr/include/libgnomecanvas-2.0
-I/usr/include/gail-1.0 -I/usr/include/libart-2.0 -I/usr/include/gtk-2.0
-I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/
-I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0
-I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng16
-I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/pango-1.0
-I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2
-D_REENTRANT  -DBSE_CONVENIENCE    -Wno-unused-command-line-argument -lrt
-pthread -Wl,-export-dynamic -Wl,-Bsymbolic-functions -Wl,--as-needed
-Wl,--no-undefined -Wl,--hash-style=both -module -avoid-version  -o
cxxplugins.FPU.la -rpath /opt/lib/beast-0-13/plugins
cxxplugins_FPU_la-bseadder.lo cxxplugins_FPU_la-bseatandistort.lo
cxxplugins_FPU_la-bsesimpleadsr.lo cxxplugins_FPU_la-bsemixer.lo
cxxplugins_FPU_la-bsemult.lo cxxplugins_FPU_la-bsesequencer.lo
cxxplugins_FPU_la-bseiirfilter.lo cxxplugins_FPU_la-davcanyondelay.lo
cxxplugins_FPU_la-davsyndrum.lo cxxplugins_FPU_la-davxtalstrings.lo
../bse/libbse-0.la -lgobject-2.0 -lgthread-2.0 -pthread -lgmodule-2.0 -pthread
-lglib-2.0 
libtool: link: rm -fr  .libs/cxxplugins.FPU.la .libs/cxxplugins.FPU.lai
.libs/cxxplugins.FPU.so
libtool: link: clang++-5.0  -fPIC -DPIC -shared -nostdlib
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.2.0/../../../x86_64-linux-gnu/crti.o
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.2.0/crtbeginS.o 
.libs/cxxplugins_FPU_la-bseadder.o .libs/cxxplugins_FPU_la-bseatandistort.o
.libs/cxxplugins_FPU_la-bsesimpleadsr.o .libs/cxxplugins_FPU_la-bsemixer.o
.libs/cxxplugins_FPU_la-bsemult.o .libs/cxxplugins_FPU_la-bsesequencer.o
.libs/cxxplugins_FPU_la-bseiirfilter.o .libs/cxxplugins_FPU_la-davcanyondelay.o
.libs/cxxplugins_FPU_la-davsyndrum.o .libs/cxxplugins_FPU_la-davxtalstrings.o  
-Wl,-rpath -Wl,/opt/src/beast/bse/.libs -Wl,-rpath -Wl,/opt/lib/beast-0-13/lib
-lrt ../bse/.libs/libbse-0.so -lgobject-2.0 -lgthread-2.0 -lgmodule-2.0
-lglib-2.0 -L/usr/bin/../lib/gcc/x86_64-linux-gnu/7.2.0
-L/usr/bin/../lib/gcc/x86_64-linux-gnu/7.2.0/../../../x86_64-linux-gnu
-L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu
-L/usr/bin/../lib/gcc/x86_64-linux-gnu/7.2.0/../../..
-L/usr/lib/llvm-5.0/bin/../lib -L/lib -L/usr/lib -lstdc++ -lm -lc -lgcc_s
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.2.0/crtendS.o
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.2.0/../../../x86_64-linux-gnu/crtn.o 
-O3 -minline-all-stringops -mmmx -msse -msse2 -msse3 -mcx16 -g -pthread -O3
-minline-all-stringops -mmmx -msse -msse2 -msse3 -mcx16 -g -pthread -pthread
-Wl,-export-dynamic -Wl,-Bsymbolic-functions -Wl,--as-needed -Wl,--no-undefined
-Wl,--hash-style=both -pthread -pthread   -pthread -Wl,-soname
-Wl,cxxplugins.FPU.so -o .libs/cxxplugins.FPU.so
clang: warning: argument unused during compilation: '-pthread'
[-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-pthread'
[-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-pthread'
[-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-pthread'
[-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-pthread'
[-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-pthread'
[-Wunused-command-line-argument]
libtool: link: ( cd ".libs" && rm -f "cxxplugins.FPU.la" && ln -s
"../cxxplugins.FPU.la" "cxxplugins.FPU.la" )
make[1]: Leaving directory '/opt/src/beast/plugins'

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180830/2b303561/attachment.html>


More information about the llvm-bugs mailing list