public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
From: Alon Bar-Lev <alon.barlev@gmail.com>
To: insight@sourceware.org
Subject: gdb/gdbtk/generic/gdbtk-stack.c - fail due to strict aliasing
Date: Sat, 25 Oct 2008 23:08:00 -0000	[thread overview]
Message-ID: <200810260107.31955.alon.barlev@gmail.com> (raw)


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. */
 

             reply	other threads:[~2008-10-25 23:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-25 23:08 Alon Bar-Lev [this message]
2008-10-26 17:15 ` Martin Rakhmanov
2008-10-27 18:43 ` Keith Seitz
2008-10-30 23:11   ` Gene Smith

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200810260107.31955.alon.barlev@gmail.com \
    --to=alon.barlev@gmail.com \
    --cc=insight@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).