[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: va_copy, new module 'stdarg'

From: Eric Blake
Subject: Re: va_copy, new module 'stdarg'
Date: Mon, 08 May 2006 06:38:34 -0600
User-agent: Thunderbird (Windows/20060308)

Hash: SHA1

According to Bruno Haible on 5/2/2006 8:31 AM:
> I propose this fix, using a va_copy detection macro that I wrote for gettext.
> (I heard that you don't like #ifdefs inside functions?)

I like the general idea, but wonder if it will work everywhere.

> 2006-05-01  Bruno Haible  <address@hidden>
>       * modules/stdarg: New file.
>       * m4/stdarg.m4: New file.
>       * modules/version-etc: Depend on stdarg.
>       * lib/version-etc.c (version_etc_va): Use va_copy.
> ================================ m4/stdarg.m4 ============================
> # stdarg.m4 serial 1
> dnl Copyright (C) 2006 Free Software Foundation, Inc.
> dnl This file is free software; the Free Software Foundation
> dnl gives unlimited permission to copy and/or distribute it,
> dnl with or without modifications, as long as this notice is preserved.
> dnl From Bruno Haible.
> dnl Provide a working va_copy in combination with <stdarg.h>.
>     if test $gl_cv_func___va_copy = yes; then
>       AC_DEFINE([va_copy], [__va_copy],
>         [Define as a macro for copying va_list variables.])
>     else
>       AH_VERBATIM([#define gl_va_copy(a,b) (a) = (b)])

My recollection from using the proprietary Green Hills Software compiler
for PowerPC at work was that they implemented va_list as a one-element
array of a struct.  They provided va_copy with their latest 4.x version
compiler, but in the 3.x version, my workaround for implementing va_copy
for their compiler ended up looking like:

#define gl_va_copy(a,b) ((a)[0] = (b)[0])

I don't know if it is worth trying to detect this in your .m4, or to
ignore it since it was a proprietary compiler where a newer version does
not need the workaround, but at least thought I would document the issue.

- --
Life is short - so eat dessert first!

Eric Blake             address@hidden
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


reply via email to

[Prev in Thread] Current Thread [Next in Thread]