Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: simon.marchi@ericsson.com (Simon Marchi)
Cc: qiyaoltc@gmail.com (Yao Qi), gdb-patches@sourceware.org
Subject: Re: [PATCH 3/2] Add some more casts (2/2)
Date: Mon, 28 Sep 2015 15:45:00 -0000	[thread overview]
Message-ID: <20150928154518.474FC2210@oc7340732750.ibm.com> (raw)
In-Reply-To: <56059010.4020702@ericsson.com> from "Simon Marchi" at Sep 25, 2015 02:18:56 PM

Simon Marchi wrote:

> @@ -1350,7 +1352,7 @@ ppu2spu_sniffer (const struct frame_unwind *self,
>        info.bfd_arch_info = bfd_lookup_arch (bfd_arch_spu, bfd_mach_spu);
>        info.byte_order = BFD_ENDIAN_BIG;
>        info.osabi = GDB_OSABI_LINUX;
> -      info.tdep_info = (void *) &data.id;
> +      info.tdep_info = (struct gdbarch_tdep_info *) &data.id;
>        data.gdbarch = gdbarch_find_by_info (info);
>        if (!data.gdbarch)
>  	return 0;

This causes compilation to fail (with the RHEL5 system compiler):

gdb/ppc-linux-tdep.c: In function 'ppu2spu_sniffer':
gdb/ppc-linux-tdep.c:1355: warning: type-punning to incomplete type might break strict-aliasing rules

The problem seems to be that "struct gdbarch_tdep_info" actually
does not exist and is not defined anywhere.  The info.tdep_info
field is used as a generic pointer; different architectures use
it for diffferent purposes.

Maybe in this case the correct fix would be to leave the (void *)
casts in place and actually change the type of the field to void * ...

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com


  reply	other threads:[~2015-09-28 15:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-23 19:31 [PATCH 2/2] Add some more casts (1/2) Simon Marchi
2015-09-23 19:31 ` [PATCH 3/2] Add some more casts (2/2) Simon Marchi
2015-09-25 13:20   ` Yao Qi
2015-09-25 18:19     ` Simon Marchi
2015-09-28 15:45       ` Ulrich Weigand [this message]
2015-09-28 17:14         ` Simon Marchi
2015-09-30 14:53           ` Simon Marchi
2015-09-30 15:16             ` Ulrich Weigand
2015-09-30 15:25               ` Simon Marchi
2015-09-25 13:17 ` [PATCH 2/2] Add some more casts (1/2) Yao Qi
2015-09-25 13:29   ` Simon Marchi
2015-09-25 18:18   ` Simon Marchi

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=20150928154518.474FC2210@oc7340732750.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=qiyaoltc@gmail.com \
    --cc=simon.marchi@ericsson.com \
    /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