Skip to content

Commit

Permalink
Fix compilation with GCC-7 and latest RoaringBitmap code
Browse files Browse the repository at this point in the history
Latest RoaringBitmap version (introduced with bf413af) triggers a new
warning with GCC-7:

```
ivan@ivan-Latitude-E6540:~/svnrepos/nDPI(dev)$ CC=gcc-7 CXX=g++-7 ./autogen.sh && make -s
autoreconf: Entering directory `.'
[...]
third_party/src/roaring.c:1815:1: warning: ‘no_sanitize’ attribute directive ignored [-Wattributes]
 static inline int array_container_cardinality(const array_container_t *array) {
 ^~~~~~
third_party/src/roaring.c:1964:5: warning: ‘no_sanitize’ attribute directive ignored [-Wattributes]
     const array_container_t *container2) {
[..]
```

The core issue is that `no_sanitize` attribute is defined only for GCC
>= 8.
That breaks the CI since we still use GCC-7 and `-Werror`: add a simple
workaround.

Fix compilation on Windows
  • Loading branch information
IvanNardi committed Feb 13, 2023
1 parent 85bab9e commit c3731ac
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@ AS_IF([test "x${enable_tls_sigs}" = "xyes"],[
HANDLE_TLS_SIGS=""
])

NDPI_CFLAGS="-W -Wall -Wno-unused-parameter -Wno-unused-function -Wno-address-of-packed-member ${NDPI_CFLAGS}"
NDPI_CFLAGS="-W -Wall -Wno-unused-parameter -Wno-unused-function -Wno-address-of-packed-member ${NDPI_CFLAGS} -Wno-attributes"
#Workaround for RoaringBitmap with gcc-7
NDPI_CFLAGS="-Wno-attributes ${NDPI_CFLAGS}"

AS_IF([test "${with_lto_and_gold_linker+set}" = set], [
NDPI_CFLAGS="${NDPI_CFLAGS} -flto -fuse-ld=gold -Wno-unused-command-line-argument"
Expand Down
1 change: 1 addition & 0 deletions windows/nDPI.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@
<ClCompile Include="..\src\lib\protocols\z3950.c" />
<ClCompile Include="..\src\lib\protocols\zabbix.c" />
<ClCompile Include="..\src\lib\third_party\src\ahocorasick.c" />
<ClCompile Include="..\src\lib\third_party\src\roaring.c" />
<ClCompile Include="..\src\lib\protocols\armagetron.c" />
<ClCompile Include="..\src\lib\protocols\bgp.c" />
<ClCompile Include="..\src\lib\protocols\bittorrent.c" />
Expand Down
1 change: 1 addition & 0 deletions windows/nDPI.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
<ClCompile Include="..\src\lib\protocols\z3950.c" />
<ClCompile Include="..\src\lib\protocols\zabbix.c" />
<ClCompile Include="..\src\lib\third_party\src\ahocorasick.c">
<ClCompile Include="..\src\lib\third_party\src\roaring.c">
<Filter>third_party</Filter>
</ClCompile>
<ClCompile Include="..\src\lib\third_party\src\ndpi_sha1.c">
Expand Down

0 comments on commit c3731ac

Please sign in to comment.