On Thu, Nov 13, 2014 at 1:31 PM, FX <fxcoud...@gmail.com> wrote:
>> Regtested on x86_64-unknown-linux-gnu, Ok for trunk?
>
> OK two me, with three comments:
>
>>    * intrinsics/chmod.c (chmod_internal): New function, move logic
>>    here.
>>    (chmod_func): Call chmod_internal.
>
> Not sure what’s the need / benefit from this, given the function is only 
> called once.

Just a convenience; chmod_internal returns from quite a few places.
Rather than sprinkling free() calls before all those, I used a wrapper
function. As it's called only once, and it's a static function, it
should be inlined anyway.

>>    * intrinsics/random.c (random_seed_i4): Use static buffer rather
>>    than VLA, use _Static_assert to make sure it's big enough.
>
> This array has constant size, known at compilation time. Isn’t it allowed to 
> have an array with “const int” as size? I though it was.

I originally thought so, but apparently not, as it fails to compile
with -Werror=vla. Same for the other couple places where I replaced a
static const variable with a macro. The reason might be that the
const-ness can be casted away, and then one can write to the variable?

>>    * io/read.c (read_f): Likewise.
>
> Is the known upper bound you have chosen (#define READF_TMP 50) compatible 
> with the largest float we support, i.e. real(16)?
> So that we avoid using allocation for reading data we have written ourselves 
> in default format :)

Yeah, I used the test program below:

program maxgf
  implicit none
  print *, huge(0._10)
  print *, -huge(0._16)
  print *, '123456789012345678901234567890123456789012345678901234567890'
end program maxgf

=> something like 45 characters should be enough. Then I added a few
extra just to be sure to cover all the common cases.


Thanks for the quick review, committed as r217480.

-- 
Janne Blomqvist

Reply via email to