[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fpending Android bug

From: Bruno Haible
Subject: Re: fpending Android bug
Date: Sat, 14 Jan 2023 18:07:26 +0100

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

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
      grep -i fpending config.status
  - say which NDK version you're using,
  - say what is the __ANDROID_API__ value in your environment.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]