Skip to content

Commit

Permalink
weappers: Use --{start,end}-no-unused-arguments instead of -Qunused-a…
Browse files Browse the repository at this point in the history
…rguments

This keeps warnings for other unused arguments passed by the user.

This requires a version of llvm-project past
50ec1306d060e46e0d53c9f5d8a052e1b0d10d3b (Jan 2022) which added these
new options.
  • Loading branch information
mstorsjo committed Jan 11, 2022
1 parent 0340afb commit 5ba36f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion wrappers/clang-target-wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ int _tmain(int argc, TCHAR* argv[]) {
if (getenv("CCACHE"))
exec_argv[arg++] = _T("ccache");
exec_argv[arg++] = concat(dir, _T(CLANG));
exec_argv[arg++] = _T("--start-no-unused-arguments");

// If changing this wrapper, change clang-target-wrapper.sh accordingly.
if (!_tcscmp(exe, _T("clang++")) || !_tcscmp(exe, _T("g++")) || !_tcscmp(exe, _T("c++")))
Expand Down Expand Up @@ -94,7 +95,7 @@ int _tmain(int argc, TCHAR* argv[]) {
exec_argv[arg++] = _T("-unwindlib=libunwind");
exec_argv[arg++] = _T("-stdlib=libc++");
exec_argv[arg++] = _T("-fuse-ld=lld");
exec_argv[arg++] = _T("-Qunused-arguments");
exec_argv[arg++] = _T("--end-no-unused-arguments");

for (int i = 1; i < argc; i++)
exec_argv[arg++] = argv[i];
Expand Down
3 changes: 2 additions & 1 deletion wrappers/clang-target-wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ fi
# If changing this wrapper, change clang-target-wrapper.c accordingly.
CLANG="$DIR/clang"
FLAGS=""
FLAGS="$FLAGS --start-no-unused-arguments"
case $EXE in
clang++|g++|c++)
FLAGS="$FLAGS --driver-mode=g++"
Expand Down Expand Up @@ -87,6 +88,6 @@ FLAGS="$FLAGS -rtlib=compiler-rt"
FLAGS="$FLAGS -unwindlib=libunwind"
FLAGS="$FLAGS -stdlib=libc++"
FLAGS="$FLAGS -fuse-ld=lld"
FLAGS="$FLAGS -Qunused-arguments"
FLAGS="$FLAGS --end-no-unused-arguments"

$CCACHE "$CLANG" $FLAGS "$@"

0 comments on commit 5ba36f4

Please sign in to comment.