tools/netmap/pkt-gen: clang error

Navdeep Parhar nparhar at gmail.com
Tue May 30 18:30:22 UTC 2017


You can suppress the warning with something like this:
# cd /usr/src/tools/tools/netmap
# WARNS=2 make

Regards,
Navdeep


On Tue, May 30, 2017 at 10:54 AM, Harry Schmalzbauer <freebsd at omnilan.de> wrote:
>  Hello,
>
> after merging netmap code from head I can't compile pkt-gen from
> usr/src/tools/tools/netmap:
> cc  -O2 -pipe -Werror -Wall -Wextra -march=ivybridge  -g -std=gnu99
> -fstack-protector-strong    -Qunused-arguments -Qunused-arguments
> -std=gnu99 -fstack-protector-strong    -Qunused-arguments
> -Qunused-arguments  -c pkt-gen.c -o pkt-gen.o
> pkt-gen.c:650:19: error: taking address of packed member 'ip' of class
> or structure 'pkt' may result in an unaligned pointer value
>       [-Werror,-Waddress-of-packed-member]
>         struct ip *ip = &pkt->ip;
>                          ^~~~~~~
> pkt-gen.c:651:24: error: taking address of packed member 'udp' of class
> or structure 'pkt' may result in an unaligned pointer value
>       [-Werror,-Waddress-of-packed-member]
>         struct udphdr *udp = &pkt->udp;
>                               ^~~~~~~~
> pkt-gen.c:745:8: error: taking address of packed member 'ip' of class or
> structure 'pkt' may result in an unaligned pointer value
>       [-Werror,-Waddress-of-packed-member]
>         ip = &pkt->ip;
>               ^~~~~~~
> pkt-gen.c:762:9: error: taking address of packed member 'udp' of class
> or structure 'pkt' may result in an unaligned pointer value
>       [-Werror,-Waddress-of-packed-member]
>         udp = &pkt->udp;
>
> Quick hints highly appreciated.
>
> Thanks,
>
> -harry
> _______________________________________________
> freebsd-net at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"


More information about the freebsd-net mailing list