You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/05/03 06:17:02 UTC
[GitHub] [incubator-nuttx] btashton commented on a change in pull request #953: x86_64: Make sure to clone ap list in vasprintf
btashton commented on a change in pull request #953:
URL: https://github.com/apache/incubator-nuttx/pull/953#discussion_r419054750
##########
File path: libs/libc/stdio/lib_vasprintf.c
##########
@@ -58,7 +58,7 @@
#define ap1 ap
#define ap2 ap
-#if defined(CONFIG_ARCH_X86)
+#if defined(CONFIG_ARCH_X86) || defined(CONFIG_ARCH_X86_64)
Review comment:
I think it is OK. If anything this is a place where we should add the conditional to avoid the copy if the arch is not leaving it on the stack.
From `stdarg.h` in gcc
```
#if !defined(__STRICT_ANSI__) || __STDC_VERSION__ + 0 >= 199900L || defined(__GXX_EXPERIMENTAL_CXX0X__)
#define va_copy(d,s) __builtin_va_copy(d,s)
#endif
#define __va_copy(d,s) __builtin_va_copy(d,s)
```
and `stdarg.h` in clang
```
/* GCC always defines __va_copy, but does not define va_copy unless in c99 mode
* or -ansi is not specified, since it was not part of C90.
*/
#define __va_copy(d,s) __builtin_va_copy(d,s)
#if __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L || !defined(__STRICT_ANSI__)
#define va_copy(dest, src) __builtin_va_copy(dest, src)
#endif
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org