Golevka / emacs-clang-complete-async

An emacs plugin to complete C and C++ code using libclang
360 stars 71 forks source link

Build fails with GCC from -Wcovered-switch-default #37

Closed arsenm closed 1 year ago

arsenm commented 11 years ago

cc -pipe -std=c99 -I/usr/local/include -pipe -fPIC -Wall -W -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -g -D_GNU_SOURCE -DSTDC_CONSTANT_MACROS -DSTDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Wall -Wextra -pedantic -O3 -I./src -c -o src/obj/completion_serv.o ./src/completion_serv.c cc: error: unrecognized command line option ‘-Wcovered-switch-default’

toojays commented 11 years ago

You didn't write how you caused that error, but I guess that it came just from running make in a clean checkout.

My second guess is that -Wcovered-switch-default comes from llvm-config --cflags, which the makefile runs to determine what flags are required to build a program which uses libclang. If that's the case, it also means that you need to build using Clang as the compiler rather than GCC, because GCC does not understand -Wcovered-switch-default.

You should be able to do this by running make CC=clang rather than just make.