lixingcong / dnsmasq-regex

dnsmasq with regex match module(libpcre v8.45, the older version)
66 stars 15 forks source link

Compile warnings when building from source on FreeBSD 13.2 #11

Closed quistian closed 1 year ago

quistian commented 1 year ago

I am trying to use dnsmasq-regex on a FreeBSD 13.2 system:

$ uname -a FreeBSD fbsd13_2 13.2-RELEASE FreeBSD 13.2-RELEASE releng/13.2-n254617-525ecfdad597 GENERIC amd64

$ c++ --version FreeBSD clang version 14.0.5 (https://github.com/llvm/llvm-project.git llvmorg-14.0.5-0-gc12386ae247c) Target: x86_64-unknown-freebsd13.2 Thread model: posix InstalledDir: /usr/bin

and in doing so there are warnings when compiling due to data alignment issues:

8 warnings generated. cc -Wall -W -O2 -DHAVE_REGEX -DVERSION='"2.89-44-g9bbf098"' -c nftset.c In file included from nftset.c:18: ./dnsmasq.h:352:18: warning: field 'addr' with variable sized type 'union all_addr' not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end] union all_addr addr; ^ ./dnsmasq.h:418:18: warning: field 'addr' with variable sized type 'union all_addr' not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end] union all_addr addr;

Are these warnings superficial and can they be ignored? Or does one have to add some compiler flags?

lixingcong commented 1 year ago

Add -Wno-gnu-variable-sized-type-not-at-end to cflags if you like.