GCC 4.8 libcpp Issue...Possibly Related To (FIXED)
Jonathan Wakely
jwakely.gcc@gmail.com
Sat Nov 2 13:20:00 GMT 2013
On 28 October 2013 18:22, Cyd Haselton <chaselton@gmail.com> wrote:
> On Sun, Oct 27, 2013 at 6:36 PM, Cyd Haselton <chaselton@gmail.com> wrote:
>
> On Oct 27, 2013 6:36 PM, "Cyd Haselton" <chaselton@gmail.com> wrote:
>>
>> Android apparently doesn't support implicit conversion so had to do a
>> cast before the argument is passed.
>>
>> I added
>>
>> off_t ot = (off_t) &file->st.st_size;
>>
>> before _cpp_convert_input, and passed &ot to argument 7 in _cpp_convert_input.
>>
>
> UPDATE: The above modification allowed the build to complete but results in a
> bad address error when resulting binaries are run on device.
> Will revise and try again...and email gcc-bugs if necessary.
Not surprising, that modification is utterly broken. You're casting
the address of st_size to an off_t, when you should be using it's
value, not its address.
You could try:
off_t ot = file->st.st_size;
Then pass &ot into the function and then:
file->st.st_size; = ot;
But I have to wonder why Android's struct stat has the wrong type for
the st_size member, is it not meant to be a POSIX conforming library?
More information about the Gcc-help
mailing list