Infinite loop in dcraw with current GCC versions
Manuel López-Ibáñez
lopezibanez@gmail.com
Mon Mar 2 11:27:00 GMT 2015
On 2 March 2015 at 12:14, Andrew Haley <aph@redhat.com> wrote:
> On 03/02/2015 11:08 AM, Manuel López-Ibáñez wrote:
>> Actually, the question that I was unsure about and I could not find a
>> ready answer in the standard is whether one can use ((double
>> *)(&cam_xyz[0][0]))[j] to address the whole multidimensional array.
>> The C-FAQ seems to suggest that one cannot, but it is not crystal
>> clear in this respect.
>
> It may not be, but the passage I sent you is.
The way I read that passage is that *cam_xyz is of type double[3] and
*(*cam_xyz) is of type 'double', but it doesn't say anything about
dereferencing the pointer &(*(*cam_xyz)) beyond any limits. This also
raises the question of whether is valid to initialize a
multidimensional array with memset as memset(&cam_xyz[0][0], 0,
sizeof(cam_xyz)).
More information about the Gcc-help
mailing list