This is the mail archive of the
mailing list for the GCC project.
Re: Infinite loop in dcraw with current GCC versions
- From: Manuel López-Ibáñez <lopezibanez at gmail dot com>
- To: Andrew Haley <aph at redhat dot com>
- Cc: dcoffin at shell dot cybercom dot net, "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>, Conchúr Navid <conchur at web dot de>, Sven Eckelmann <sven at narfation dot org>, René Rebe ExactCODE <rene at exactcode dot com>
- Date: Mon, 2 Mar 2015 12:26:56 +0100
- Subject: Re: Infinite loop in dcraw with current GCC versions
- Authentication-results: sourceware.org; auth=none
- References: <CAESRpQDZs=EZTAj7bO5Dn8d=M8p8MuN7_s__XNatnL2BWgs9wA at mail dot gmail dot com> <CAESRpQBx7V=O-pH5Ckvt=XpJHYyEwCyZGz1HQTByqdKftQC0MQ at mail dot gmail dot com> <20150227190206 dot GA6175 at shell dot cybercom dot net> <CAESRpQCCWVQGeWMByFFiX6MLoA-VxJ3AAp5u99VdOy7h8SsgQg at mail dot gmail dot com> <20150227204552 dot GA8916 at shell dot cybercom dot net> <CAESRpQAbO-6Zy3FBvR56NDiAGJg8CZYtSTUPLR5jud0baNHKHg at mail dot gmail dot com> <54F2FBA6 dot 1060308 at redhat dot com> <CAESRpQA466GP9CSv17Dcw3t7LyNrhatJ7Rh13OEopGj6wVHE2Q at mail dot gmail dot com> <54F44610 dot 5010101 at redhat dot com>
On 2 March 2015 at 12:14, Andrew Haley <firstname.lastname@example.org> 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))[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 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,