This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: GCC 4.8 libcpp Issue...Possibly Related To (FIXED)
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Cyd Haselton <chaselton at gmail dot com>
- Cc: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Sat, 2 Nov 2013 13:20:12 +0000
- Subject: Re: GCC 4.8 libcpp Issue...Possibly Related To (FIXED)
- Authentication-results: sourceware.org; auth=none
- References: <CAHu5Pra=xMPYU1=ramkMH+jJyE27CyoGY+C6D-7DttXD8KrWxg at mail dot gmail dot com> <CAHu5Prbwk2BP3kX+66fUkBLr=-okDfnJnVfyFGx63BiyLAoO9g at mail dot gmail dot com>
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?