J'utilise le drapeau -Werror
pour traiter tous les avertissements comme des erreurs dans mon code. Cependant, j'aimerais que les avertissements issus du code soient toujours considérés comme des avertissements. Une option GCC pour cela est -Wno-error=cpp
qui fonctionne correctement, mais l'option clang est -Wno-error=#warnings
que je ne sais pas comment passer à clang
de Android.mk
.Comment faire pour échapper correctement hash dans Android.mk?
J'ai essayé ceci:
ifeq "$(findstring clang,$(NDK_TOOLCHAIN_VERSION))" "clang"
LOCAL_CFLAGS += -Wno-error=#warnings
endif
et cela (comme le suggère this SO answer):
ifeq "$(findstring clang,$(NDK_TOOLCHAIN_VERSION))" "clang"
LOCAL_CFLAGS += -Wno-error=\#warnings
endif
Cependant, les deux versions traitent #
comme début de commentaire et ndk-build
passe -Wno-error=
au compilateur (ie tout après =
est ignoré) - J'ai inspecté cela avec ndk-build -n
.
J'ai même essayé
ifeq "$(findstring clang,$(NDK_TOOLCHAIN_VERSION))" "clang"
LOCAL_CFLAGS += -Wno-error=\\#warnings
endif
qui produit -Wno-error=\
option du compilateur.
Comment passer correctement cet indicateur du compilateur pour clanger à partir du fichier Android.mk
? J'utilise NDK r12b.
EDIT: Je même essayé ceci:
ifeq "$(findstring clang,$(NDK_TOOLCHAIN_VERSION))" "clang"
VAR=\#warnings
$(info VAR is '$(VAR)')
LOCAL_CFLAGS += -Wno-error=$(VAR)
endif
et ndk-build
premiers arguments sorties un message VAR is '#warnings'
encore compilateur contiennent -Wno-error=
. C'est évidemment un problème NDK.
essayé. Dans la ligne de commande se termine '" -Wno-error = '. Cela semble être un problème NDK, pas un problème makefile.J'ai signalé le problème [ici] (https://github.com/android-ndk/ ndk/issues/161). – DoDo