This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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]

Re: Avoid gcc warning on sparc solaris 9


Pedro Alves wrote:

> Building HEAD on a native gdb on sparc solaris 9 with gcc 3.4.6 stops due to:
> 
> ../../src/gdb/sol-thread.c: In function `sol_thread_fetch_registers':
> ../../src/gdb/sol-thread.c:533: warning: dereferencing type-punned
> pointer will break strict-aliasing rules

We've seen this on other platforms with gcc 3.4 as well.  I think
the best fix would be replace the problematic construct
  supply_gregset (regcache, (const gdb_gregset_t *) &gregset);
with

 gdb_gregset_t *gregset_p = &gregset;

 supply_gregset (regcache, (const gdb_gregset_t *) gregset_p);

That seemed to fix the problems e.g. in i386-linux-nat.c (fetch_regs).


Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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