libs/libc/stdio: Fix long long usage in all of the newer printf-related logic: The selection CONFIG_LIBC_LONG_LONG must be ignored if the architecture does not support long long types.

This commit is contained in:
Gregory Nutt 2019-06-03 08:45:57 -06:00
parent 7a0481d2a9
commit d375a26a6c
3 changed files with 22 additions and 2 deletions

View File

@ -80,6 +80,9 @@ config LIBC_LONG_LONG
libraries that will be drawn into the build if long long support libraries that will be drawn into the build if long long support
is enabled. is enabled.
NOTE: This setting has no effect if the underlying architecture
cannot support long long types
config LIBC_NUMBERED_ARGS config LIBC_NUMBERED_ARGS
bool "Enable numbered arguments in printf" bool "Enable numbered arguments in printf"
default n default n

View File

@ -1,8 +1,8 @@
/**************************************************************************** /****************************************************************************
* libs/libc/stdio/lib_libsscanf.c * libs/libc/stdio/lib_libsscanf.c
* *
* Copyright (C) 2007, 2008, 2011-2014, 2016, 2019 Gregory Nutt. All rights * Copyright (C) 2007, 2008, 2011-2014, 2016, 2019 Gregory Nutt. All
* reserved. * rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* Johannes Schock * Johannes Schock
* *
@ -52,6 +52,7 @@
#include <errno.h> #include <errno.h>
#include <debug.h> #include <debug.h>
#include <nuttx/compiler.h>
#include <nuttx/streams.h> #include <nuttx/streams.h>
#include "libc.h" #include "libc.h"
@ -60,6 +61,14 @@
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
/* CONFIG_LIBC_LONG_LONG is not a valid selection of the compiler does not
* support long long types.
*/
#ifndef CONFIG_HAVE_LONG_LONG
# undef CONFIG_LIBC_LONG_LONG
#endif
#define MAXLN 128 #define MAXLN 128
#define HH_MOD -2 #define HH_MOD -2

View File

@ -48,6 +48,14 @@
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
/* CONFIG_LIBC_LONG_LONG is not a valid selection of the compiler does not
* support long long types.
*/
#ifndef CONFIG_HAVE_LONG_LONG
# undef CONFIG_LIBC_LONG_LONG
#endif
/* Next flags are to use with `base'. Unused fields are reserved. */ /* Next flags are to use with `base'. Unused fields are reserved. */
#define XTOA_PREFIX 0x0100 /* Put prefix for octal or hex */ #define XTOA_PREFIX 0x0100 /* Put prefix for octal or hex */