summaryrefslogtreecommitdiffstats
path: root/src/include/gpxe/in.h
diff options
context:
space:
mode:
authorMichael Brown2009-01-06 04:19:23 +0100
committerMichael Brown2009-01-06 04:20:26 +0100
commit85e5e25c52834788239eb8b6c94e0d3aeddd2705 (patch)
tree0e4d282d413a18f3365846e35830645c2580bacd /src/include/gpxe/in.h
parent[efi] Inhibit harmless ld warning on unresolved symbol check (diff)
downloadipxe-85e5e25c52834788239eb8b6c94e0d3aeddd2705.tar.gz
ipxe-85e5e25c52834788239eb8b6c94e0d3aeddd2705.tar.xz
ipxe-85e5e25c52834788239eb8b6c94e0d3aeddd2705.zip
[build] Avoid strict-aliasing warnings when building with gcc 4.4
Conventional usage of the various struct sockaddr_xxx types involves liberal use of casting, which tends to trigger strict-aliasing warnings from gcc. Avoid these now and in future by marking all the relevant types with __attribute__((may_alias)).
Diffstat (limited to 'src/include/gpxe/in.h')
-rw-r--r--src/include/gpxe/in.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/include/gpxe/in.h b/src/include/gpxe/in.h
index 40e4d4073..831a6110f 100644
--- a/src/include/gpxe/in.h
+++ b/src/include/gpxe/in.h
@@ -71,7 +71,7 @@ struct sockaddr_in {
char pad[ sizeof ( struct sockaddr ) - sizeof ( sa_family_t )
- sizeof ( uint16_t )
- sizeof ( struct in_addr ) ];
-};
+} __attribute__ (( may_alias ));
/**
* IPv6 socket address
@@ -87,7 +87,7 @@ struct sockaddr_in6 {
uint32_t sin6_flowinfo; /* Flow number */
struct in6_addr sin6_addr; /* 128-bit destination address */
uint32_t sin6_scope_id; /* Scope ID */
-};
+} __attribute__ (( may_alias ));
extern int inet_aton ( const char *cp, struct in_addr *inp );
extern char * inet_ntoa ( struct in_addr in );