[Info-vax] VMS 9.2 release build completed, release approaching
Jake Hamby
jake.hamby at gmail.com
Wed Jun 29 12:27:31 EDT 2022
On Wednesday, June 29, 2022 at 5:53:04 AM UTC-7, xyzz... at gmail.com wrote:
> Copying a va_list has always been something that should have used va_copy().
> You can cheat with a direct assigment of va_list's on VAX, Alpha, and Itanium
> since va_lists are just arrays of pointers. That isn't true on x86. A va_list is a
> struct with some fields, several pointers, and more. You have to ask the
> compiler to do that for you with the va_copy() intrinsic. That is what every
> piece of opensource code on Linux does today (or it wouldn't work). Added
> to the problem is that the va_copy from C99 was only added into the headers
> by VSI. (On Alpha & Itanium, it just expands into an assignment. On x86, it is
> a real intrinsic that we have to pass along to LLVM).
>
> And while I'm here, please, please, please switch from <varargs.h> to <stdarg.h>
> if you are still using it. The model presented to us by LLVM is the stdarg model.
> We have to do extra work to hack up varargs.
Thanks for the info: now I know that it's safe to replace va_copy() with an assignment on Alpha & Itanium with the current V7.4 compilers. The current <stdarg.h> has:
#if !defined(__x86_64) /* Verified for x86, John Reagan */
...
#if defined(__DECC) && (__DECC_VER >= 70500000)
#define va_copy(cp, ap) cp = (__va_list) ((__char_ptr32) __VA_COPY_BUILTIN(ap))
#endif
#endif
#if defined(__x86_64) /* Verified for x86, John Reagan */
...
#if !defined (__DECCXX)
#define va_copy(cp, ap) cp = __VA_COPY_BUILTIN(ap)
#endif
#endif
So I have to define my own va_copy() in the meantime.
More information about the Info-vax
mailing list