This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [patch/rfc] Eliminate char buf[MAX_REGISTER_RAW_SIZE]
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Fri, 31 Jan 2003 18:26:43 -0500
- Subject: Re: [patch/rfc] Eliminate char buf[MAX_REGISTER_RAW_SIZE]
- References: <3E3AFFA5.9080902@redhat.com> <jehebooqja.fsf@sykes.suse.de>
Andrew Cagney <ac131313@redhat.com> writes:
|> Hello,
|>
|> Since MAX_REGISTER_RAW_SIZE is implemented using a function the declaration:
|>
|> char buf[MAX_REGISTER_RAW_SIZE];
|>
|> is illegal. (GCC does allow it which is why no one notices :-/).
|>
|> The attached patch updates all obvious (as in found by a grep) occurances
|> of this and changes them to:
|>
|> char *buf = alloca (max_register_raw_size (current_gdbarch));
You have used max_register_size in the patch. Which of the two is
correct?
Oops, max_register_size() is correct. (I've built all the cross targets).
Hmm, I also forgot to mention that it hit both MAX_REGISTER_RAW_SIZE and
MAX_REGISTER_VIRTUAL_SIZE.
Andrew