On Mon, Sep 28, 2015 at 12:09:19 +0200, Bernd Schmidt wrote: > On 09/28/2015 12:03 PM, Bernd Schmidt wrote: > >On 09/28/2015 10:26 AM, Thomas Schwinge wrote: > >>- objcopy_argv[8] = NULL; > >>+ objcopy_argv[objcopy_argc++] = NULL; > >>+ gcc_checking_assert (objcopy_argc <= OBJCOPY_ARGC_MAX); > > > >On its own this is not an improvement - you're trading a compile time > >error for a runtime error. So, what is the other change this is > >preparing for? > > Ok, I now see the other patch. But I also see that other code in the same > file and in the nvptx mkoffload is using the obstack_ptr_grow method to > build argv arrays, I think that would be preferrable to this.
I've removed obstack_ptr_grow for arrays with known sizes after this review: https://gcc.gnu.org/ml/gcc-patches/2014-10/msg02210.html -- Ilya