* gdb/gdbtk/generic/gdbtk-stack.c - fail due to strict aliasing
@ 2008-10-25 23:08 Alon Bar-Lev
2008-10-26 17:15 ` Martin Rakhmanov
2008-10-27 18:43 ` Keith Seitz
0 siblings, 2 replies; 4+ messages in thread
From: Alon Bar-Lev @ 2008-10-25 23:08 UTC (permalink / raw)
To: insight
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. */
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: gdb/gdbtk/generic/gdbtk-stack.c - fail due to strict aliasing
2008-10-25 23:08 gdb/gdbtk/generic/gdbtk-stack.c - fail due to strict aliasing Alon Bar-Lev
@ 2008-10-26 17:15 ` Martin Rakhmanov
2008-10-27 18:43 ` Keith Seitz
1 sibling, 0 replies; 4+ messages in thread
From: Martin Rakhmanov @ 2008-10-26 17:15 UTC (permalink / raw)
To: Alon Bar-Lev; +Cc: insight
This allows to compile currently available snapshot
(ftp://sourceware.org/pub/insight/snapshots/current/insight-weekly-6.8.50-20081021-tar.bz2)
but again does not fix problem with running insight on Fedora 9: the
snapshot ships with old tcl/tk versions and uses them.
Thanks
Martin
Alon Bar-Lev wrote:
> 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. */
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: gdb/gdbtk/generic/gdbtk-stack.c - fail due to strict aliasing
2008-10-25 23:08 gdb/gdbtk/generic/gdbtk-stack.c - fail due to strict aliasing Alon Bar-Lev
2008-10-26 17:15 ` Martin Rakhmanov
@ 2008-10-27 18:43 ` Keith Seitz
2008-10-30 23:11 ` Gene Smith
1 sibling, 1 reply; 4+ messages in thread
From: Keith Seitz @ 2008-10-27 18:43 UTC (permalink / raw)
To: Alon Bar-Lev; +Cc: insight
Alon Bar-Lev wrote:
> Reported as binutils bug#6986 [1]
>
> arguments = *(int*) &clientData;
Thank you for the patch: it's not quite correct, but then the existing
code is completely wrong. That got really botched somehow: clientData is
an int, not an int*. I don't know how I messed that up. O:-)
I've committed a proper fix. Or at least I think I have, since gcc 4.4.0
no longer complains about this. Let me know if this still presents
problems for you.
I'm remaking the snapshot to include this patch.
Keith
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: gdb/gdbtk/generic/gdbtk-stack.c - fail due to strict aliasing
2008-10-27 18:43 ` Keith Seitz
@ 2008-10-30 23:11 ` Gene Smith
0 siblings, 0 replies; 4+ messages in thread
From: Gene Smith @ 2008-10-30 23:11 UTC (permalink / raw)
To: insight
Keith Seitz wrote:
> Alon Bar-Lev wrote:
>
>> Reported as binutils bug#6986 [1]
>>
>> arguments = *(int*) &clientData;
>
> Thank you for the patch: it's not quite correct, but then the existing
> code is completely wrong. That got really botched somehow: clientData is
> an int, not an int*. I don't know how I messed that up. O:-)
>
> I've committed a proper fix. Or at least I think I have, since gcc 4.4.0
> no longer complains about this. Let me know if this still presents
> problems for you.
>
> I'm remaking the snapshot to include this patch.
>
> Keith
>
1027 SS won't build as pointed out other msg. When I manually apply this
patch to 1021 SS it builds OK.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-10-30 23:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-25 23:08 gdb/gdbtk/generic/gdbtk-stack.c - fail due to strict aliasing Alon Bar-Lev
2008-10-26 17:15 ` Martin Rakhmanov
2008-10-27 18:43 ` Keith Seitz
2008-10-30 23:11 ` Gene Smith
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).