This is the mail archive of the insight@sourceware.org mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gdb/gdbtk/generic/gdbtk-stack.c - fail due to strict aliasing


Hello,

Reported as binutils bug#6986 [1]

arguments = *(int*) &clientData;

Gets strict aliasing warning that escalate to error and fails build.

Attached a simple temp fix against head.

But the apparently the original has some issue too.

Regards,
Alon Bar-Lev.

------- Additional Comment #2 From Andreas Schwab 2008-10-25 22:53   ------- 
Neither gdb nor gdbtk are part of binutils.  And the patch is as broken as the 
original code, it still fails on big-endian 64-bit architectures.  Please 
report that to the insight mailinglist.

[1] http://sourceware.org/bugzilla/show_bug.cgi?id=6986

---

Index: gdb/gdbtk/generic/gdbtk-stack.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-stack.c,v
retrieving revision 1.29
diff -u -B -r1.29 gdbtk-stack.c
--- gdb/gdbtk/generic/gdbtk-stack.c	2 Sep 2008 17:29:23 -0000	1.29
+++ gdb/gdbtk/generic/gdbtk-stack.c	25 Oct 2008 22:28:12 -0000
@@ -285,7 +285,10 @@
       return TCL_ERROR;
     }
 
-  arguments = *(int*) &clientData;
+{
+  void *p = &clientData;
+  arguments = *(int*) p;
+}
 
   /* Initialize the result pointer to an empty list. */
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]