Shuzheng
Shuzheng

Reputation: 14006

clang++ warning: "warning: unknown warning option '-Wno-maybe-uninitialized'"

Having installed LLVM on Ubuntu 16.04 using the command:

sudo apt-get install clang llvm

I get the following error when compiling:

nlykkei@nlykkei-VirtualBox:~$ clang++ -g toy.cpp `llvm-config --cxxflags --ldflags --system-libs --libs` -o toy
warning: unknown warning option '-Wno-maybe-uninitialized'; did you mean
      '-Wno-uninitialized'? [-Wunknown-warning-option]
1 warning generated.

To be specific, I follow the tutorial: http://llvm.org/docs/tutorial/LangImpl03.html on the LLVM website.

The version of LLVM is 3.8.

How do I get rid of this warning?

Thanks.

Upvotes: 9

Views: 18300

Answers (3)

Shivendra
Shivendra

Reputation: 1558

Answer mentioned here https://github.com/envoyproxy/envoy/issues/18986 might help. Mostly changing Wno-maybe-uninitialized with -Wno-uninitialized in / bazel/envoy_internal.bzl

Upvotes: 0

Shiva Yadav
Shiva Yadav

Reputation: 140

This warning comes when you recently upgraded your sdk-build-tools with 30.x

I resolved the issue by downgrading sdk-build-tools by 29.x.

Delete all the intermediate files , they will be auto generate again.

Clean Project .

Invalidate Cashes and Restart the Project.

Woow, warning has been removed now.

Upvotes: 0

cnicutar
cnicutar

Reputation: 182684

This is a bug in llvm-config. Long story short, llvm-config outputs -Wno-maybe-uninitialized which is not a warning implemented by clang.

One possible workaround is to add an extra flag squelching warnings about unknown warnings.

clang++ <your flags> -Wno-unknown-warning-option `llvm-config ...`

Upvotes: 13

Related Questions