This is the mail archive of the
mailing list for the binutils project.
Re: GOLD: RFA: Fixing a coverty error for aarch64.cc
> I would suggest letting the compiler handle computing
> array sizes. Something like the below. (Build tested
> only, feel free to run with it). If you restore the
> pointer with something like:
> + const static Insntype* ST_E_835769_INSNS = ST_E_843419_INSNS;
> - // ST_E_835769 has the same stub template as ST_E_843419.
> - install_insn_template_insns(ST_E_835769, ST_E_843419);
> + install_insn_template(ST_E_835769);
> Then the compiler catches the problem:
I like your suggestion, but I'm curious whether this depends on any
more recent features of C++ or the compiler. Would this work, say,
with GCC 4.2 (which is close to the oldest compiler we claim will work
for building gold)? Would it work with 4.6?
I'm not averse to moving the line forward a bit, but I don't think I'd
want to move it too far forward in one jump, or for the sake of one
minor patch. (For example, at some point, I'd like to start using auto
types and range-based for loops, among other not-all-that-new-anymore