diff options
| -rw-r--r-- | CMakeLists.txt | 25 | ||||
| -rw-r--r-- | src/libwifi/core/radiotap/radiotap.c | 5 | ||||
| -rw-r--r-- | src/libwifi/gen/management/timing_ad.c | 1 |
3 files changed, 27 insertions, 4 deletions
| diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f1b89e..750eb52 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -7,11 +7,29 @@ execute_process(COMMAND git log -1 --pretty=format:%h OUTPUT_STRIP_TRAILING_WHIT | |||
| 7 | execute_process(COMMAND date OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE BUILDTIME) | 7 | execute_process(COMMAND date OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE BUILDTIME) |
| 8 | set(LIBWIFI_VERSION "0.0.8") | 8 | set(LIBWIFI_VERSION "0.0.8") |
| 9 | 9 | ||
| 10 | |||
| 10 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu17") | 11 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu17") |
| 11 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra") | 12 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat=2") |
| 12 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wno-language-extension-token") | 13 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector-strong -D_FORTIFY_SOURCE=2 ") |
| 13 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-prototypes -Wstrict-prototypes") | 14 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-prototypes -Wstrict-prototypes") |
| 14 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector-strong") | 15 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2") |
| 16 | |||
| 17 | if(CMAKE_CXX_COMPILER_ID MATCHES "^(Apple)?Clang$") | ||
| 18 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Walloca -Wformat-security -Wnull-dereference -Wstack-protector") | ||
| 19 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wvla -Warray-bounds -Warray-bounds-pointer-arithmetic -Wassign-enum -Wbad-function-cast") | ||
| 20 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wconditional-uninitialized -Wfloat-equal -Wformat-type-confusion -Widiomatic-parentheses") | ||
| 21 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wimplicit-fallthrough -Wloop-analysis -Wpointer-arith") | ||
| 22 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wswitch-enum -Wtautological-constant-in-range-compare -Wunreachable-code-aggressive -Wcomma") | ||
| 23 | else() | ||
| 24 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wformat-overflow=2 -Wformat-truncation=2 -Wformat-security -Wnull-dereference -Wstack-protector") | ||
| 25 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wtrampolines -Walloca -Wvla -Warray-bounds=2 -Wimplicit-fallthrough=3 -Wtraditional-conversion") | ||
| 26 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wshift-overflow=2 -Wcast-qual -Wstringop-overflow=4 -Wconversion -Wlogical-op") | ||
| 27 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wduplicated-cond -Wduplicated-branches -Wformat-signedness -Wshadow -Wstrict-overflow=4 -Wundef") | ||
| 28 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wstack-usage=1000000 -Wcast-align=strict") | ||
| 29 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-clash-protection -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -Wl,-z,separate-code") | ||
| 30 | endif(CMAKE_CXX_COMPILER_ID MATCHES "^(Apple)?Clang$") | ||
| 31 | |||
| 32 | |||
| 15 | 33 | ||
| 16 | set(CMAKE_MACOSX_RPATH 1) | 34 | set(CMAKE_MACOSX_RPATH 1) |
| 17 | 35 | ||
| @@ -50,6 +68,7 @@ set_target_properties(wifi PROPERTIES SOVERSION 0) | |||
| 50 | set_target_properties(wifi PROPERTIES PUBLIC_HEADER src/libwifi.h) | 68 | set_target_properties(wifi PROPERTIES PUBLIC_HEADER src/libwifi.h) |
| 51 | 69 | ||
| 52 | add_library(wifi_static STATIC ${libwifi_src}) | 70 | add_library(wifi_static STATIC ${libwifi_src}) |
| 71 | set_target_properties(wifi_static PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -fPIE") | ||
| 53 | set_target_properties(wifi_static PROPERTIES LINKER_LANGUAGE C) | 72 | set_target_properties(wifi_static PROPERTIES LINKER_LANGUAGE C) |
| 54 | set_target_properties(wifi_static PROPERTIES VERSION ${LIBWIFI_VERSION}) | 73 | set_target_properties(wifi_static PROPERTIES VERSION ${LIBWIFI_VERSION}) |
| 55 | set_target_properties(wifi_static PROPERTIES PUBLIC_HEADER src/libwifi.h) | 74 | set_target_properties(wifi_static PROPERTIES PUBLIC_HEADER src/libwifi.h) |
| diff --git a/src/libwifi/core/radiotap/radiotap.c b/src/libwifi/core/radiotap/radiotap.c index 5d46223..77786d4 100644 --- a/src/libwifi/core/radiotap/radiotap.c +++ b/src/libwifi/core/radiotap/radiotap.c | |||
| @@ -317,7 +317,10 @@ EXPORT | |||
| 317 | int ieee80211_radiotap_iterator_next(struct ieee80211_radiotap_iterator *iterator) { | 317 | int ieee80211_radiotap_iterator_next(struct ieee80211_radiotap_iterator *iterator) { |
| 318 | while (1) { | 318 | while (1) { |
| 319 | int hit = 0; | 319 | int hit = 0; |
| 320 | int pad, align, size, subns; | 320 | int pad = 0; |
| 321 | int align = 0; | ||
| 322 | int size = 0; | ||
| 323 | int subns = 0; | ||
| 321 | uint32_t oui; | 324 | uint32_t oui; |
| 322 | 325 | ||
| 323 | /* if no more EXT bits, that's it */ | 326 | /* if no more EXT bits, that's it */ |
| diff --git a/src/libwifi/gen/management/timing_ad.c b/src/libwifi/gen/management/timing_ad.c index 73a1188..b7985cb 100644 --- a/src/libwifi/gen/management/timing_ad.c +++ b/src/libwifi/gen/management/timing_ad.c | |||
| @@ -79,6 +79,7 @@ int libwifi_create_timing_advert(struct libwifi_timing_advert *adv, | |||
| 79 | offset += sizeof(adv_fields->time_error); | 79 | offset += sizeof(adv_fields->time_error); |
| 80 | memcpy(element_data + offset, &adv_fields->time_update, sizeof(adv_fields->time_update)); | 80 | memcpy(element_data + offset, &adv_fields->time_update, sizeof(adv_fields->time_update)); |
| 81 | offset += sizeof(adv_fields->time_update); | 81 | offset += sizeof(adv_fields->time_update); |
| 82 | break; | ||
| 82 | } | 83 | } |
| 83 | default: | 84 | default: |
| 84 | break; | 85 | break; |
