Farhan/openssh
Revisión | 596e91616e2459cdefbea04554b85669ea4e4856 (tree) |
---|---|
Tiempo | 2017-11-11 11:44:13 |
Autor | Chih-Hung Hsieh <chh@goog...> |
Commiter | Chih-Hung Hsieh |
Use -Werror and -Wno-error in external/openssh
* Suppress non-critical warnings.
* Keep other warnings to fix later.
* Some warnings cannot be suppressed so we added -Wno-error at the end.
Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I746ba8f7dc48232678af87749ef23789ee982aa7
@@ -1,5 +1,26 @@ | ||
1 | 1 | LOCAL_PATH:= $(call my-dir) |
2 | 2 | |
3 | +openssh_common_cflags := \ | |
4 | + -Wall \ | |
5 | + -Werror \ | |
6 | + -Wno-error=implicit-function-declaration \ | |
7 | + -Wno-pointer-sign \ | |
8 | + -Wno-sign-compare \ | |
9 | + -Wno-type-limits \ | |
10 | + -Wno-unused-parameter \ | |
11 | + -Wno-unused-variable \ | |
12 | + -Wno-error \ | |
13 | + | |
14 | +# Use -Wno-error to allow at least the following warnings: | |
15 | +# (1) bsd-openpty.c calls to 'ptsname' declared with attribute warning: | |
16 | +# ptsname is not thread-safe; use ptsname_r instead [-Werror] | |
17 | +# (2) external/boringssl/src/include/openssl/opensslfeatures.h: | |
18 | +# error: "OPENSSL_NO_BF" redefined [-Werror] | |
19 | + | |
20 | +openssh_common_clang_cflags := \ | |
21 | + -Wno-incompatible-pointer-types \ | |
22 | + -Wno-macro-redefined \ | |
23 | + | |
3 | 24 | ###################### libssh ###################### |
4 | 25 | include $(CLEAR_VARS) |
5 | 26 |
@@ -123,7 +144,8 @@ LOCAL_SHARED_LIBRARIES += libssl libcrypto libdl libz | ||
123 | 144 | |
124 | 145 | LOCAL_MODULE := libssh |
125 | 146 | |
126 | -LOCAL_CFLAGS+=-O3 -Wno-unused-parameter | |
147 | +LOCAL_CFLAGS += -O3 $(openssh_common_cflags) | |
148 | +LOCAL_CLANG_CFLAGS += $(openssh_common_clang_cflags) | |
127 | 149 | |
128 | 150 | LOCAL_CFLAGS += -DGCE_PLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION) |
129 | 151 | ifneq ($(filter gce_x86 gce_x86_64 calypso, $(TARGET_DEVICE)),) |
@@ -149,7 +171,8 @@ LOCAL_SRC_FILES := \ | ||
149 | 171 | LOCAL_MODULE := ssh |
150 | 172 | |
151 | 173 | |
152 | -LOCAL_CFLAGS += -Wno-unused-parameter | |
174 | +LOCAL_CFLAGS += $(openssh_common_cflags) | |
175 | +LOCAL_CLANG_CFLAGS += $(openssh_common_clang_cflags) | |
153 | 176 | |
154 | 177 | LOCAL_C_INCLUDES := \ |
155 | 178 | external/zlib \ |
@@ -171,7 +194,8 @@ LOCAL_SRC_FILES := \ | ||
171 | 194 | |
172 | 195 | LOCAL_MODULE := sftp |
173 | 196 | |
174 | -LOCAL_CFLAGS += -Wno-unused-parameter | |
197 | +LOCAL_CFLAGS += $(openssh_common_cflags) | |
198 | +LOCAL_CLANG_CFLAGS += $(openssh_common_clang_cflags) | |
175 | 199 | |
176 | 200 | LOCAL_C_INCLUDES := \ |
177 | 201 | external/zlib \ |
@@ -193,7 +217,8 @@ LOCAL_SRC_FILES := \ | ||
193 | 217 | |
194 | 218 | LOCAL_MODULE := scp |
195 | 219 | |
196 | -LOCAL_CFLAGS += -Wno-unused-parameter | |
220 | +LOCAL_CFLAGS += $(openssh_common_cflags) | |
221 | +LOCAL_CLANG_CFLAGS += $(openssh_common_clang_cflags) | |
197 | 222 | |
198 | 223 | LOCAL_C_INCLUDES := \ |
199 | 224 | external/zlib \ |
@@ -257,7 +282,8 @@ LOCAL_SRC_FILES := \ | ||
257 | 282 | |
258 | 283 | LOCAL_MODULE := sshd |
259 | 284 | |
260 | -LOCAL_CFLAGS += -Wno-unused-parameter | |
285 | +LOCAL_CFLAGS += $(openssh_common_cflags) | |
286 | +LOCAL_CLANG_CFLAGS += $(openssh_common_clang_cflags) | |
261 | 287 | ifneq ($(filter gce_x86 gce_x86_64 calypso, $(TARGET_DEVICE)),) |
262 | 288 | LOCAL_CFLAGS += -DANDROID_GCE $(GCE_VERSION_CFLAGS) |
263 | 289 | endif |
@@ -282,7 +308,8 @@ LOCAL_SRC_FILES := \ | ||
282 | 308 | |
283 | 309 | LOCAL_MODULE := ssh-keygen |
284 | 310 | |
285 | -LOCAL_CFLAGS += -Wno-unused-parameter | |
311 | +LOCAL_CFLAGS += $(openssh_common_cflags) | |
312 | +LOCAL_CLANG_CFLAGS += $(openssh_common_clang_cflags) | |
286 | 313 | |
287 | 314 | LOCAL_C_INCLUDES := \ |
288 | 315 | external/zlib \ |