You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2022/03/08 14:34:05 UTC

[incubator-nuttx] 02/05: libc/stdio: Skip fetch double argument if !CONFIG_LIBC_FLOATINGPOINT && CONFIG_LIBC_NUMBERED_ARGS

This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 428ce93ee5d7f5e0719d393606aa19ab98632d75
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Tue Mar 8 16:34:23 2022 +0800

    libc/stdio: Skip fetch double argument if !CONFIG_LIBC_FLOATINGPOINT && CONFIG_LIBC_NUMBERED_ARGS
    
    since the argument is already fetched by lib_vsprintf in this case
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 libs/libc/stdio/lib_libvsprintf.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libs/libc/stdio/lib_libvsprintf.c b/libs/libc/stdio/lib_libvsprintf.c
index 7d34427..7d449cb 100644
--- a/libs/libc/stdio/lib_libvsprintf.c
+++ b/libs/libc/stdio/lib_libvsprintf.c
@@ -937,7 +937,9 @@ static int vsprintf_internal(FAR struct lib_outstream_s *stream,
 #else /* !CONFIG_LIBC_FLOATINGPOINT */
       if ((c >= 'E' && c <= 'G') || (c >= 'e' && c <= 'g'))
         {
+#  ifndef CONFIG_LIBC_NUMBERED_ARGS
           va_arg(ap, double);
+#  endif
           pnt  = "*float*";
           size = sizeof("*float*") - 1;
           goto str_lpad;