Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang-cl warning: argument unused during compilation: '-O0' #2811

Closed
Latias94 opened this issue Sep 13, 2022 · 6 comments
Closed

clang-cl warning: argument unused during compilation: '-O0' #2811

Latias94 opened this issue Sep 13, 2022 · 6 comments
Labels
Milestone

Comments

@Latias94
Copy link
Contributor

Xmake Version

xmake v2.7.1+dev.1bf418b74

Operating System Version and Architecture

win10

Describe Bug

❯ xmake create test     
create test ...
  [+]: src\main.cpp
  [+]: xmake.lua
  [+]: .gitignore
create ok!

Administrator in D:\cpp
❯ cd .\test\

Administrator in D:\cpp\test via 🌙 
❯ xmake f --cc=clang-cl --cxx=clang-cl -m debug
checking for platform ... windows
checking for architecture ... x64
checking for Microsoft Visual Studio (x64) version ... 2022

Administrator in D:\cpp\test via 🌙 
❯ xmake -rvD
checking for clang-cl ... ok
checking for flags (-FS -Fd) ... ok
> clang-cl "-FS" "-FdC:\Users\ADMINI~1\AppData\Local\Temp\.xmake\220913\_FE7A6793777E46208270A4829AA77040.pdb"
checking for flags (-O0) ... ok
> clang-cl "-O0"
[ 25%]: cache compiling.debug src\main.cpp
clang-cl -c -Zi -FS -Fdbuild\windows\x64\debug\compile.test.pdb -O0 -Fobuild\.objs\test\windows\x64\debug\src\main.cpp.obj src\main.cpp
checking for flags (-fcolor-diagnostics) ... ok
> clang-cl "-fcolor-diagnostics"
clang-cl: warning: argument unused during compilation: '-O0' [-Wunused-command-line-argument]
[ 50%]: linking.debug test.exe
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.33.31629\\bin\\HostX64\\x64\\link.exe" -nologo -dynamicbase -nxcompat -machine:x64 -debug -pdb:build\windows\x64\debug\test.pdb -out:build\windows\x64\debug\test.exe build\.objs\test\windows\x64\debug\src\main.cpp.obj

build cache stats:
cache directory: build\.build_cache
cache hit rate: 0%
cache hit: 0
cache miss: 0
new cached files: 0
remote cache hit: 0
remote new cached files: 0
preprocess failed: 0
compile fallback count: 0

[100%]: build ok!

Expected Behavior

no warning

Project Configuration

No response

Additional Information and Error Logs

No response

@Latias94 Latias94 added the bug label Sep 13, 2022
@waruqi waruqi added this to the v2.7.2 milestone Sep 13, 2022
@waruqi
Copy link
Member

waruqi commented Sep 13, 2022

I haven't fixed it yet, but I don't think it should be a problem.

@Latias94
Copy link
Contributor Author

Nevermind, I just don't like warnings.

@Latias94
Copy link
Contributor Author

warning occur again

xmake update dev
xmake -rvD
...
clang-cl: warning: argument unused during compilation: '-O3' [-Wunused-command-line-argument]

@Latias94 Latias94 reopened this Sep 16, 2022
@waruqi
Copy link
Member

waruqi commented Sep 17, 2022

I cannot remove it, xmake doesn't know when clang-cl actually uses which parameters, but you can configure the suppression warnings yourself.

you can use add_cxflags("-Wno-error=unused-command-line-argument"), or -Wno-unused-command-line-argument to suppress it.

or try set_warnings("none")

@Latias94
Copy link
Contributor Author

ok

@waruqi
Copy link
Member

waruqi commented Sep 29, 2022

I removed it, try it again. xmake update -s dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants