[cfe-dev] svn update then make gives cc1 error: unrecognized command line option '-Wcovered-switch-default'

Eli Friedman eli.friedman at gmail.com
Fri Oct 5 17:35:40 PDT 2012


On Fri, Oct 5, 2012 at 5:25 PM, Larry Evans <cppljevans at suddenlink.net> wrote:
> On 10/05/12 13:32, Larry Evans wrote:
>   I just ran svn update:
>
>   ~/download/llvm/svn/llvm $ svn update
>   ~/download/llvm/svn/llvm/tools/clang $ svn update
>   ~/download/llvm/svn/llvm/tools $ svn co
>   http://llvm.org/svn/llvm-project/clang-tools-extra/trunk extra
>   ~/download/llvm/svn/llvm/projects/compiler-rt $ svn update
>
>   However, make resulted in:
>
>   .
>   .
>   .
>   llvm[1]: Compiling regexec.c for Debug+Asserts build
>   cc1: error: unrecognized command line option "-Wcovered-switch-default"
>   /bin/rm: cannot remove
>
> `/home/evansl/download/llvm/svn/build/lib/Support/Debug+Asserts/regexec.d.tmp':
>   No such file or directory
>   make[1]: ***
>   [/home/evansl/download/llvm/svn/build/lib/Support/Debug+Asserts/regexec.o]
>   Error 1
>   make[1]: Leaving directory
>   `/home/evansl/download/llvm/svn/build/lib/Support'
>   make: *** [all] Error 1
>   ~/download/llvm/svn/build $
>
>   How can this be corrected?
>
>   My system is:
>
>   uname -a
>   Linux evansl-desktop 2.6.32-41-generic #90-Ubuntu SMP Tue May 22
>   11:29:51 UTC 2012 x86_64 GNU/Linux
>
>   TIA.
>
>   -regards,
>   Larry
> SOLVED:
>
> Changed Makefile.config to remove the COVERED_SWITCH_DEFAULT macro,
> and now it's working:
>
>   ~/download/llvm/svn/build $ cat Makefile.config|grep switch
>   # -Wcovered-switch-default
>   #COVERED_SWITCH_DEFAULT = -Wcovered-switch-default
>   ~/download/llvm/svn/build $ make
>   llvm[0]: Constructing LLVMBuild project information.
>   make[1]: Entering directory
> `/home/evansl/download/llvm/svn/build/lib/Support'
>   llvm[1]: Compiling regexec.c for Debug+Asserts build
>   llvm[1]: Compiling system_error.cpp for Debug+Asserts build
>   llvm[1]: Building Debug+Asserts Archive Library libLLVMSupport.a

Err, this is a guess, but it's possible you're setting the C++
compiler to clang++, but not setting the C compiler to clang.

-Eli



More information about the cfe-dev mailing list