Missing va_copy()

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Missing va_copy()

1,352件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by g_mocken on Tue Feb 03 06:24:10 MST 2015
Hi,

I am confused about va_copy()  (one of the macros in stdarg.h used for dealing with variadic function arguments):

It's defined as
#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)
in tools/lib/gcc/arm-none-eabi/4.8.4/include/stdarg.h, but apparently the file tools/redlib/include/stdarg.h, which omits this definition, i.e. only defines
#define va_start(v,l) __builtin_va_start((v),l)
#define va_end(v) __builtin_va_end(v)
#define va_arg(v,l)__builtin_va_arg((v),l)

is preferred - no matter what library (redlib or not) I use.

Using directly __builtin_va_copy() seems to work, but that's a quick and (possibly) dirty solution. What would be a safe and portable one?

Note that I am using C99.

G.
0 件の賞賛
返信
1 返信

1,223件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Wed Feb 04 01:40:06 MST 2015
Redlib does not implement a full C99 library, only part of it. If you want full C99 library support, you need to reconfigure your project to use Newlib / NewlibNano. If you reconfigure correctly, then the appropriate C library header files will then get picked up by the compiler.

http://www.lpcware.com/content/faq/lpcxpresso/redlib-and-newlib

Regards,
LPCXpresso Support

0 件の賞賛
返信