Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 May 2017 11:30:20 -0700
From:      Navdeep Parhar <nparhar@gmail.com>
To:        Harry Schmalzbauer <freebsd@omnilan.de>
Cc:        "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>
Subject:   Re: tools/netmap/pkt-gen: clang error
Message-ID:  <CAPFoGT9dT-aZFJ2schnVQD8r4vYMaYoc=9yvSpNHreSydvqA7w@mail.gmail.com>
In-Reply-To: <592DB1CE.8000801@omnilan.de>
References:  <592DB1CE.8000801@omnilan.de>

next in thread | previous in thread | raw e-mail | index | archive | help
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@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@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPFoGT9dT-aZFJ2schnVQD8r4vYMaYoc=9yvSpNHreSydvqA7w>