bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] vasnprintf: Don't use %n on android


From: Bruno Haible
Subject: Re: [PATCH] vasnprintf: Don't use %n on android
Date: Wed, 23 Jan 2019 01:25:30 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-141-generic; KDE/5.18.0; x86_64; ; )

Hi Tim and Hugo,

> > I also don't see much here (Debian unstable):
> > 
> > $ grep -A1 -i 'checking.*printf' config.log
> > configure:6305: checking for vasnprintf
> > configure:6305: result: no
> > configure:6305: checking for snprintf
> > configure:6305: result: yes
> > --
> > configure:8450: checking whether snprintf returns a byte count as in C99
> > configure:8548: result: yes
> > configure:8559: checking for snprintf
> > configure:8559: result: yes
> > --
> > configure:8568: checking whether _snprintf is declared
> > configure:8568: result: no
> > 
> > What does that grep look for you ?
> 
> $ grep -A1 'checking .*printf' config.log
> configure:6326: checking for vasnprintf
> configure:6326: gcc -o conftest -g -O2   conftest.c  >&5
> --
> configure:6326: checking for snprintf
> configure:6326: gcc -o conftest -g -O2   conftest.c  >&5
> --
> configure:8471: checking whether snprintf returns a byte count as in C99
> configure:8558: gcc -o conftest -g -O2   conftest.c  >&5
> --
> configure:8580: checking for snprintf
> configure:8580: result: yes
> --
> configure:8589: checking whether _snprintf is declared
> configure:8589: gcc -c -g -O2  conftest.c >&5

I did these steps:
1) Create a testdir
   ./gnulib-tool --create-testdir --dir=../testdir-printf-posix 
--single-configure \
                 dprintf-posix fprintf-posix printf-posix snprintf-posix \
                 sprintf-posix vasnprintf-posix vasprintf-posix vdprintf-posix \
                 vfprintf-posix vprintf-posix vsnprintf-posix vsprintf-posix
2) Tarred the resulting directory
3) Transfered it to the device (Android 4.3 with 'Terminal IDE' app in my case),
4) Unpacked it there,
5) configured it,
6) Copy&pasted the configure output.

The configure output contains the lines

checking whether printf supports size specifiers as in C99... yes
checking whether printf supports 'long double' arguments... yes
checking whether printf supports infinite 'double' arguments... no
checking whether printf supports infinite 'long double' arguments... no
checking whether printf supports the 'a' and 'A' directives... no
checking whether printf supports the 'F' directive... no
checking whether printf supports the 'n' directive... no
checking whether printf supports the 'ls' directive... no
checking whether printf supports POSIX/XSI format strings with positions... yes
checking whether printf supports the grouping flag... no
checking whether printf supports the left-adjust flag correctly... yes
checking whether printf supports the zero flag correctly... no
checking whether printf supports large precisions... yes
checking whether printf survives out-of-memory conditions... no
checking for snprintf... yes
checking whether snprintf truncates the result as in C99... yes
checking whether snprintf returns a byte count as in C99... yes
checking whether snprintf fully supports the 'n' directive... no
checking whether snprintf respects a size of 1... yes
checking whether vsnprintf respects a zero size as in C99... yes

With this, I am in the position to update the results in printf.m4, and
even add cross-compilation guesses.

Since snprintf is behaving well enough, we can disable the use of %n,
like you suggested.

Done through the attached patches.

Bruno


Attachment: 0001-printf-Support-cross-compilation-to-Android.patch
Description: Text Data

Attachment: 0002-vasnprintf-Don-t-use-n-on-Android.patch
Description: Text Data


reply via email to

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