bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Po Lu <luangruo@yahoo.com>
To: Bruno Haible <bruno@clisp.org>
Cc: bug-gnulib@gnu.org
Subject: Re: fpending Android bug
Date: Sun, 15 Jan 2023 08:28:41 +0800	[thread overview]
Message-ID: <87sfgcbpza.fsf@yahoo.com> (raw)
In-Reply-To: <3831502.h0BymrIErR@nimes> (Bruno Haible's message of "Sat, 14 Jan 2023 18:07:26 +0100")

Bruno Haible <bruno@clisp.org> writes:

> Before we make any change, we need to know what is wrong, i.e. what is
> "the fpending bug on Android". You haven't said so, after I asked in
>  <https://lists.gnu.org/archive/html/bug-gnulib/2022-12/msg00087.html>
>
> Please be specific: What do you mean by "not works"? Does not compile?
> Does not return which value?

Apologies for missing those details.

It doesn't compile because ->_p and ->_base are undefined in FILE *.

>> diff --git a/xcompile/lib/fpending.c b/xcompile/lib/fpending.c
>> index afa840b8512..e57155e586e 100644
>> --- a/xcompile/lib/fpending.c
>> +++ b/xcompile/lib/fpending.c
>> @@ -41,7 +41,7 @@ __fpending (FILE *fp)
>>    return fp->_IO_write_ptr - fp->_IO_write_base;
>>  #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
>>    /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin < 1.7.34, Minix 3, Android */
>> -  return fp->_p - fp->_bf._base;
>> +  return fp_->_p - fp_->_bf._base;
>>  #elif defined __EMX__                /* emx+gcc */
>>    return fp->_ptr - fp->_buffer;
>>  #elif defined __minix                /* Minix */
>
> IMO, this patch is a no-op:
>
>   - If you are using an Android NDK older than r14b, the definition of
>     'struct __sFILE' is directly in <stdio.h> and thus visible.
>
>   - If you are using an Android NDK r14b or newer, with __ANDROID_API__
>     being < 24, the definition of 'struct __sFILE' has been moved out
>     to <bits/struct_file.h> but is still included from <stdio.h> and is
>     thus visible.

I'm using the NDK r25b; however, bits/struct_file.h in the NDK r25b only
includes:

__BEGIN_DECLS

/** The opaque structure implementing `FILE`. Do not make any assumptions about its content. */
struct __sFILE {
#if defined(__LP64__)
  char __private[152];
#else
  char __private[84];
#endif
} __attribute__((aligned(sizeof(void*))));

__END_DECLS

even when __ANDROID_API__ is 19.

> So, in order to investigate this, you need to
>   - explain what you meant by "not works",
>   - run your configure script with option -C,
>   - report the results of
>       grep -i fpending config.cache
>     and
>       grep -i fpending config.status
>   - say which NDK version you're using,
>   - say what is the __ANDROID_API__ value in your environment.

Thanks, I will do this later today.


  parent reply	other threads:[~2023-01-15  0:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87wn5pb3dv.fsf.ref@yahoo.com>
2023-01-14 14:24 ` fpending Android bug Po Lu
2023-01-14 17:07   ` Bruno Haible
2023-01-14 17:12     ` Bruno Haible
2023-01-15  0:28     ` Po Lu [this message]
2023-01-15 10:10       ` Bruno Haible
2023-01-15 11:11         ` Po Lu
2023-01-17 16:10         ` Bruno Haible

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sfgcbpza.fsf@yahoo.com \
    --to=luangruo@yahoo.com \
    --cc=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).