September 28, 2021
https://issues.dlang.org/show_bug.cgi?id=21974

--- Comment #9 from Walter Bright <bugzilla@digitalmars.com> ---
These also need to be added per https://issues.dlang.org/show_bug.cgi?id=22307 :

__builtin_va_start
__builtin_va_arg
__builtin_va_end

--
September 28, 2021
https://issues.dlang.org/show_bug.cgi?id=21974

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dave287091@gmail.com

--- Comment #10 from Walter Bright <bugzilla@digitalmars.com> ---
*** Issue 22307 has been marked as a duplicate of this issue. ***

--
September 28, 2021
https://issues.dlang.org/show_bug.cgi?id=21974

--- Comment #11 from Walter Bright <bugzilla@digitalmars.com> ---
The following code:

#include <stdarg.h>

#define  MAXARGS     31

int execl(const char *file, const char *args, ...)
{
    va_list ap;
    char *array[MAXARGS +1];
    int argno = 0;


    va_start(ap, args);
    while (args != 0 && argno < MAXARGS)
    {
        array[argno++] = args;
        args = va_arg(ap, const char *);
    }
    array[argno] = (char *) 0;
    va_end(ap);
    return execv(file, array);
}


when compiled with gcc -E test.c produces:

# 1 "test.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "<command-line>" 2
# 1 "test.c"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 98 "/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 2 "test.c" 2



int execl(const char *file, const char *args, ...)
{
    va_list ap;
    char *array[31 +1];
    int argno = 0;


    __builtin_va_start(ap,args);
    while (args != 0 && argno < 31)
    {
        array[argno++] = args;
        args = __builtin_va_arg(ap,const char *);
    }
    array[argno] = (char *) 0;
    __builtin_va_end(ap);
    return execv(file, array);
}

--
September 28, 2021
https://issues.dlang.org/show_bug.cgi?id=21974

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|importC: Error: undefined   |ImportC: support
                   |identifier                  |__builtin_va_list,
                   |'__builtin_va_list'         |__builtin_va_start,
                   |                            |__builtin_va_arg,
                   |                            |__builtin_va_end

--
September 28, 2021
https://issues.dlang.org/show_bug.cgi?id=21974

--- Comment #12 from dave287091@gmail.com ---
There’s also __builtin_va_copy for va_copy.

--
September 28, 2021
https://issues.dlang.org/show_bug.cgi?id=21974

--- Comment #13 from Walter Bright <bugzilla@digitalmars.com> ---
https://github.com/dlang/dmd/pull/13107 solves the specific __builtin_va_list problem, but not the general problem.

The general problem could be addressed by importing core.stdc.stdarg into the C semantic routines and thereby hijacking the D implementation for use with the C code.

--
October 20, 2021
https://issues.dlang.org/show_bug.cgi?id=21974

--- Comment #14 from Walter Bright <bugzilla@digitalmars.com> ---
https://github.com/dlang/dmd/pull/13205

adds support for __builtin_va_start and __builtin_va_end

--
December 13, 2021
https://issues.dlang.org/show_bug.cgi?id=21974

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=22589

--
December 14, 2021
https://issues.dlang.org/show_bug.cgi?id=21974

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=22597

--
January 22, 2022
https://issues.dlang.org/show_bug.cgi?id=21974

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #15 from Walter Bright <bugzilla@digitalmars.com> ---
Fixed by https://github.com/dlang/dmd/pull/13532

--
1 2
Next ›   Last »