Skip to content
Snippets Groups Projects
Commit 82d5fddf authored by Adrien Vergé's avatar Adrien Vergé
Browse files

ipv4: Fix new GCC 6 strict-aliasing errors

The new version of the GCC compiler complains about an inline cast:

    In file included from /usr/include/string.h:630:0,
                     from src/ipv4.c:22:
    src/ipv4.c: In function ‘ipv4_show_route’:
    src/ipv4.h:62:12: error: dereferencing type-punned pointer will
    break strict-aliasing rules [-Werror=strict-aliasing]
      (((struct sockaddr_in *) &(route)->rt_dst)->sin_addr)
                ^
    src/ipv4.c:42:39: note: in expansion of macro ‘route_dest’
      strncat(show_route_buffer, inet_ntoa(route_dest(route)), 15);
                                           ^~~~~~~~~~

This commit introduces a dummy function to get rid of these errors.
parent 5e177aaa
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment