1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-13 11:42:21 +00:00

Fix build on Ubuntu 18.04 ARMv7 (re: 4d7ea081)

hyenias writes, re the referenced commit:
> This has caused my Ubuntu 18.04 ARMv7 to fail to compile.
>
> /dev/shm/ksh/src/lib/libast/hash/hashalloc.c: In function 'hashalloc':
> /dev/shm/ksh/src/lib/libast/hash/hashalloc.c:156:11: error:
> incompatible types when assigning to type 'va_list * {aka
> __va_list *}' from type 'va_list {aka __va_list}'
>     tmpval = va_listval(va_arg(ap, va_listarg));
>            ^
> In file included from ./ast_common.h:192:0,
>                  from /dev/shm/ksh/src/lib/libast/include/ast_std.h:37,
>                  from /dev/shm/ksh/src/lib/libast/include/ast.h:36,
>                  from /dev/shm/ksh/src/lib/libast/hash/hashlib.h:34,
>                  from /dev/shm/ksh/src/lib/libast/hash/hashalloc.c:33:
> /dev/shm/ksh/src/lib/libast/hash/hashalloc.c:157:16: error:
> incompatible type for argument 2 of '__builtin_va_copy'
>     va_copy(ap, tmpval);
>                 ^
> /dev/shm/ksh/src/lib/libast/hash/hashalloc.c:157:16: note: expected
> '__va_list' but argument is of type 'va_list * {aka __va_list *}'
> mamake [lib/libast]: *** exit code 1 making hashalloc.o
> mamake: *** exit code 1 making lib/libast
> mamake: *** exit code 1 making all
> package: make done  at Fri May 14 06:10:16 EDT 2021 in
> /dev/shm/ksh/arch/linux.arm

src/lib/libast/hash/hashalloc.c,
src/lib/libast/string/tokscan.c:
- Revert the FreeBSD fix.
- Backport a conditional workaround for clang from ksh 93v- beta.
This commit is contained in:
Martijn Dekker 2021-05-14 16:31:19 +02:00
parent 4d7ea081d3
commit e521b81636
2 changed files with 20 additions and 6 deletions

View file

@ -50,7 +50,6 @@ hashalloc(Hash_table_t* ref, ...)
va_list* vp = va;
Hash_region_f region = 0;
void* handle;
va_listarg tmpval;
va_start(ap, ref);
@ -153,8 +152,16 @@ hashalloc(Hash_table_t* ref, ...)
va_copy(*vp, ap);
vp++;
}
tmpval = va_listval(va_arg(ap, va_listarg));
va_copy(ap, tmpval);
#if __clang__ && __SIZEOF_POINTER__ == 4
{
va_list np;
np = va_listval(va_arg(ap, va_listarg));
va_copy(ap, np);
}
#else
va_copy(ap, va_listval(va_arg(ap, va_listarg)));
#endif
break;
case 0:
if (vp > va)

View file

@ -189,7 +189,6 @@ tokscan(register char* s, char** nxt, const char* fmt, ...)
char** p_string;
char* prv_f = 0;
va_list prv_ap;
va_listarg tmpval;
va_start(ap, fmt);
if (!*s || *s == '\n')
@ -235,8 +234,16 @@ tokscan(register char* s, char** nxt, const char* fmt, ...)
prv_f = f;
f = va_arg(ap, char*);
va_copy(prv_ap, ap);
tmpval = va_listval(va_arg(ap, va_listarg));
va_copy(ap, tmpval);
#if __clang__ && __SIZEOF_POINTER__ == 4
{
va_list np;
np = va_listval(va_arg(ap, va_listarg));
va_copy(ap, np);
}
#else
va_copy(ap, va_listval(va_arg(ap, va_listarg)));
#endif
continue;
case 'c':
p_char = va_arg(ap, char*);