[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Warnings when compiling the Hurd -- strict aliasing
From: |
Thomas Schwinge |
Subject: |
Warnings when compiling the Hurd -- strict aliasing |
Date: |
Thu, 14 Jun 2007 16:42:10 +0200 |
User-agent: |
Mutt/1.5.11 |
Hello!
For the following list of warnings (which were also already included in
my previous email's list) I think (I didn't really check so far ;-) that
the following patch might eliminate a chunk of those. Alternatively we
would have to apply some `union'ing magic in a lot of places. From the
quick glance I had, the problem is that MIG only handles data structures
via the `vm_address_t' type, whereas in the C code those are pointers to
structures. But I only had a quick glance, so I may be off.
Patch for GNU Mach.
#v+
--- mach/std_types.h.ORIG 2007-06-08 11:23:05.000340000 +0000
+++ mach/std_types.h 2007-06-08 11:24:03.000000000 +0000
@@ -39,7 +39,7 @@
#include <mach/machine/vm_types.h>
typedef vm_offset_t pointer_t;
-typedef vm_offset_t vm_address_t;
+typedef vm_offset_t __attribute__ ((__may_alias__)) vm_address_t;
#ifdef MACH_KERNEL
#include <ipc/ipc_port.h>
#v-
#v+
../../libstore/unzipstore.c: In function ???zwrite???:
../../libstore/unzipstore.c:140: warning: dereferencing type-punned pointer
will break strict-aliasing rules
../../libdiskfs/io-map-cntl.c: In function ???diskfs_S_io_map_cntl???:
../../libdiskfs/io-map-cntl.c:37: warning: dereferencing type-punned pointer
will break strict-aliasing rules
../../libpipe/pq.c: In function ???packet_extend???:
../../libpipe/pq.c:189: warning: dereferencing type-punned pointer will break
strict-aliasing rules
../../exec/exec.c: In function ???map???:
../../exec/exec.c:485: warning: dereferencing type-punned pointer will break
strict-aliasing rules
../../exec/exec.c: In function ???prepare???:
../../exec/exec.c:745: warning: dereferencing type-punned pointer will break
strict-aliasing rules
../../exec/do-bunzip2.c: In function ???cleanUpAndFail???:
../../exec/do-bunzip2.c:1648: warning: dereferencing type-punned pointer will
break strict-aliasing rules
../../exec/do-bunzip2.c:1649: warning: dereferencing type-punned pointer will
break strict-aliasing rules
../../exec/do-bunzip2.c:1650: warning: dereferencing type-punned pointer will
break strict-aliasing rules
../../exec/do-bunzip2.c:1651: warning: dereferencing type-punned pointer will
break strict-aliasing rules
../../init/init.c: In function ???reboot_system???:
../../init/init.c:259: warning: dereferencing type-punned pointer will break
strict-aliasing rules
../../fatfs/fat.c: In function ???fat_read_sblock???:
../../fatfs/fat.c:76: warning: dereferencing type-punned pointer will break
strict-aliasing rules
../../storeio/storeio.c: In function ???open_hook???:
../../storeio/storeio.c:252: warning: dereferencing type-punned pointer will
break strict-aliasing rules
../../boot/boot_script.c: In function ???add_arg???:
../../boot/boot_script.c:188: warning: dereferencing type-punned pointer will
break strict-aliasing rules
../../boot/boot_script.c: In function ???sym_enter???:
../../boot/boot_script.c:221: warning: dereferencing type-punned pointer will
break strict-aliasing rules
../../boot/boot_script.c: In function ???boot_script_parse_line???:
../../boot/boot_script.c:281: warning: dereferencing type-punned pointer will
break strict-aliasing rules
../../boot/boot_script.c:364: warning: dereferencing type-punned pointer will
break strict-aliasing rules
../../exec/elfcore.c: In function ???dump_core???:
../../exec/elfcore.c:342: warning: dereferencing type-punned pointer will break
strict-aliasing rules
../../exec/elfcore.c:375: warning: dereferencing type-punned pointer will break
strict-aliasing rules
../../exec/elfcore.c:375: warning: dereferencing type-punned pointer will break
strict-aliasing rules
../../exec/elfcore.c:378: warning: dereferencing type-punned pointer will break
strict-aliasing rules
../../exec/elfcore.c:378: warning: dereferencing type-punned pointer will break
strict-aliasing rules
../../exec/elfcore.c:380: warning: dereferencing type-punned pointer will break
strict-aliasing rules
../../exec/elfcore.c:380: warning: dereferencing type-punned pointer will break
strict-aliasing rules
../../exec/elfcore.c:383: warning: dereferencing type-punned pointer will break
strict-aliasing rules
../../exec/elfcore.c:383: warning: dereferencing type-punned pointer will break
strict-aliasing rules
../../exec/elfcore.c:383: warning: dereferencing type-punned pointer will break
strict-aliasing rules
../../exec/elfcore.c:383: warning: dereferencing type-punned pointer will break
strict-aliasing rules
../../exec/elfcore.c:383: warning: dereferencing type-punned pointer will break
strict-aliasing rules
../../exec/elfcore.c:383: warning: dereferencing type-punned pointer will break
strict-aliasing rules
../../exec/elfcore.c:383: warning: dereferencing type-punned pointer will break
strict-aliasing rules
../../exec/elfcore.c:383: warning: dereferencing type-punned pointer will break
strict-aliasing rules
../../exec/elfcore.c:383: warning: dereferencing type-punned pointer will break
strict-aliasing rules
../../exec/elfcore.c:386: warning: dereferencing type-punned pointer will break
strict-aliasing rules
../../exec/elfcore.c:386: warning: dereferencing type-punned pointer will break
strict-aliasing rules
../../trans/fakeroot.c: In function ???netfs_attempt_utimes???:
../../trans/fakeroot.c:520: warning: dereferencing type-punned pointer will
break strict-aliasing rules
../../trans/fakeroot.c:520: warning: dereferencing type-punned pointer will
break strict-aliasing rules
../../console-client/vga.c: In function ???vga_display_write???:
../../console-client/vga.c:706: warning: dereferencing type-punned pointer will
break strict-aliasing rules
../../console-client/vga.c:706: warning: dereferencing type-punned pointer will
break strict-aliasing rules
../../console-client/pc-mouse.c: In function ???input_loop???:
../../console-client/pc-mouse.c:245: warning: dereferencing type-punned pointer
will break strict-aliasing rules
../../console-client/ncursesw.c: In function ???mvwputsn???:
../../console-client/ncursesw.c:447: warning: dereferencing type-punned pointer
will break strict-aliasing rules
../../console-client/ncursesw.c:457: warning: dereferencing type-punned pointer
will break strict-aliasing rules
../../console-client/ncursesw.c:459: warning: dereferencing type-punned pointer
will break strict-aliasing rules
../../utils/login.c: In function ???check_owned???:
../../utils/login.c:268: warning: dereferencing type-punned pointer will break
strict-aliasing rules
../../utils/rpctrace.c: In function ???trace_and_forward???:
../../utils/rpctrace.c:765: warning: dereferencing type-punned pointer will
break strict-aliasing rules
../../utils/rpctrace.c:765: warning: dereferencing type-punned pointer will
break strict-aliasing rules
#v-
Regards,
Thomas
signature.asc
Description: Digital signature