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: [PATCH] tilegx-tdep: Correct aliasing errors in `tilegx_analyze_prologue'


On 10/18/2016 04:50 AM, Maciej W. Rozycki wrote:
>> > 
>> > Sure, please do ahead.
>> > 
>> > I'd be better if tilegx.h used uint32_t/uint64_t, etc,
>> > but that can always be done separately by someone motivated.

>  The issue there is `tilegx.h' is shared with binutils which have not yet 
> moved past C89 I believe.  Of course the use of `long long' is already 
> non-C89, however it's been there with some C89 compilers before `stdint.h' 
> types have been introduced.  We could use `bfd_uint64_t' instead, but that 
> would make `tilegx.h' depend on a BFD header.  So it's not an obvious call 
> and therefore I agree it's best left to someone who has an actual interest 
> with the target.

Yeah, C89 on paper.  :-)  It's certainly fine to use unadorned uint64_t etc.
directly nowadays.  Even if the host compiler is so old that it doesn't
support those, we have "bfd_stdint.h" to fill the gap:

 opcodes/aarch64-dis.h:23:#include "bfd_stdint.h"
 opcodes/nds32-dis.c:30:#include "bfd_stdint.h"
 opcodes/aarch64-dis.c:22:#include "bfd_stdint.h"
 ld/elf-hints-local.h:28:#include "bfd_stdint.h"

Something like 'grep "u\?int\(8\|16\|32\|64\)_t" -rn'
will show many uses of uint32_t, etc. (not bfd_uint*_t) throughout
opcodes, bfd, ld, etc.  I won't be surprised at all if someone
missed adding bfd_stdint.h for some of them and they've been
working in practice for a long while.

(better than bfd_stdint.h would be to use gnulib for the whole
toolchain, not just for gdb, but that's yet another matter.)

As I've been suggesting in recent C++11 discussions,
IMO, what we claim to support in theory matters significantly
less than what we actually support in practice.  And in
practice, all it matters is which compilers (and their versions),
not standards, people care about actually using and supporting.
Standards give us guidelines, not final answers.

>  Committed now, thanks for your review.

Thanks.

Thanks,
Pedro Alves


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