1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00
cde/src/lib/libast/hash
Martijn Dekker 4d7ea081d3 Fix build on macOS M1, FreeBSD powerpc64*, et al (?)
On some systems, the following won't compile because of the way the
macros are defined in the system headers:

	va_copy(ap, va_listval(va_arg(ap, va_listarg)));

The error from clang is something like:

  .../hashalloc.c:155:16: error: non-const lvalue reference to type
  '__builtin_va_list' cannot bind to a temporary of type 'va_list'
  (aka 'char *')
     va_copy(ap, va_listval(va_arg(ap, va_listarg)));
     ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ./ast_common.h:200:23: note: expanded from macro 'va_listval'
  #define va_listval(p) (p)
                        ^
  .../include/stdarg.h:27:53: note: expanded from macro 'va_copy'
  #define va_copy(dest, src)  __builtin_va_copy(dest, src)
                                                      ^~~
  1 error generated.
  mamake [lib/libast]: *** exit code 1 making hashalloc.o

This commit backports a FreeBSD build fix from:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255308

Thanks to Chase <nicetrynsa@protonmail.ch> for the bug report.

src/lib/libast/hash/hashalloc.c,
src/lib/libast/string/tokscan.c:
- Store va_listval() result in variable and pass that to va_copy().
2021-05-14 04:52:29 +02:00
..
hashalloc.c Fix build on macOS M1, FreeBSD powerpc64*, et al (?) 2021-05-14 04:52:29 +02:00
hashdump.c Add ksh 93u+m contributors notice to 964 copyright headers 2021-04-26 00:19:31 +01:00
hashfree.c Add ksh 93u+m contributors notice to 964 copyright headers 2021-04-26 00:19:31 +01:00
hashlast.c Add ksh 93u+m contributors notice to 964 copyright headers 2021-04-26 00:19:31 +01:00
hashlib.h Add ksh 93u+m contributors notice to 964 copyright headers 2021-04-26 00:19:31 +01:00
hashlook.c Add ksh 93u+m contributors notice to 964 copyright headers 2021-04-26 00:19:31 +01:00
hashscan.c Add ksh 93u+m contributors notice to 964 copyright headers 2021-04-26 00:19:31 +01:00
hashsize.c Add ksh 93u+m contributors notice to 964 copyright headers 2021-04-26 00:19:31 +01:00
hashview.c Add ksh 93u+m contributors notice to 964 copyright headers 2021-04-26 00:19:31 +01:00
hashwalk.c Add ksh 93u+m contributors notice to 964 copyright headers 2021-04-26 00:19:31 +01:00
memhash.c Add ksh 93u+m contributors notice to 964 copyright headers 2021-04-26 00:19:31 +01:00
memsum.c Add ksh 93u+m contributors notice to 964 copyright headers 2021-04-26 00:19:31 +01:00
strhash.c Add ksh 93u+m contributors notice to 964 copyright headers 2021-04-26 00:19:31 +01:00
strkey.c Add ksh 93u+m contributors notice to 964 copyright headers 2021-04-26 00:19:31 +01:00
strsum.c Add ksh 93u+m contributors notice to 964 copyright headers 2021-04-26 00:19:31 +01:00