eliminate aliasing warning in networking/route.c

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2011-01-20 11:29:00 +01:00
parent 53f30b41ec
commit b3b6c8bdf2
2 changed files with 41 additions and 36 deletions

View File

@ -133,7 +133,8 @@ static smallint detect_link_mii(void)
{
/* char buffer instead of bona-fide struct avoids aliasing warning */
char buf[sizeof(struct ifreq)];
struct ifreq *ifreq = (void *)buf;
struct ifreq *const ifreq = (void *)buf;
struct mii_ioctl_data *mii = (void *)&ifreq->ifr_data;
set_ifreq_to_ifname(ifreq);
@ -155,7 +156,8 @@ static smallint detect_link_priv(void)
{
/* char buffer instead of bona-fide struct avoids aliasing warning */
char buf[sizeof(struct ifreq)];
struct ifreq *ifreq = (void *)buf;
struct ifreq *const ifreq = (void *)buf;
struct mii_ioctl_data *mii = (void *)&ifreq->ifr_data;
set_ifreq_to_ifname(ifreq);