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

Hi Po Lu,

> I think I now have the right fix for the fpending bug on Android.

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?

> 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.

  - If you are using an Android NDK with __ANDROID_API__ being >= 23,
    the function __fpending exists and is declared, and therefore the
    Gnulib m4/fpending.m4 arranges to not compile fpending.c.

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.

Bruno





  reply	other threads:[~2023-01-14 17:07 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 [this message]
2023-01-14 17:12     ` Bruno Haible
2023-01-15  0:28     ` Po Lu
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=3831502.h0BymrIErR@nimes \
    --to=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    --cc=luangruo@yahoo.com \
    /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).