kcat / openal-soft

OpenAL Soft is a software implementation of the OpenAL 3D audio API.
Other
2.23k stars 535 forks source link

filter.cpp:63:5: error: ‘va_start’ was not declared in this scope #413

Closed ArthurSonzogni closed 4 years ago

ArthurSonzogni commented 4 years ago

I have a library depending on OpenAL. I updated the OpenAL version from: 5e2e4d50d324f713a7c39cdc71ce9050d2c34b5e to: 0dc9b03

My travis bot is now failing on Linux+GCC, but suceed on Linux+GCC. Maybe a recent patch? https://travis-ci.com/github/ArthurSonzogni/smk/builds/159844127

[  0%] Building CXX object _deps/openal-build/CMakeFiles/OpenAL.dir/common/alcomplex.cpp.o
[  0%] Building CXX object _deps/openal-build/CMakeFiles/OpenAL.dir/common/alexcpt.cpp.o
[  0%] Building CXX object _deps/openal-build/CMakeFiles/OpenAL.dir/common/alfstream.cpp.o
[  0%] Building CXX object _deps/openal-build/CMakeFiles/OpenAL.dir/common/almalloc.cpp.o
[  0%] Building CXX object _deps/openal-build/CMakeFiles/OpenAL.dir/common/alstring.cpp.o
[  0%] Building CXX object _deps/openal-build/CMakeFiles/OpenAL.dir/common/bsinc_tables.cpp.o
[  2%] Building CXX object _deps/openal-build/CMakeFiles/OpenAL.dir/common/dynload.cpp.o
[  2%] Building CXX object _deps/openal-build/CMakeFiles/OpenAL.dir/common/polyphase_resampler.cpp.o
[  2%] Building CXX object _deps/openal-build/CMakeFiles/OpenAL.dir/common/strutils.cpp.o
[  2%] Building CXX object _deps/openal-build/CMakeFiles/OpenAL.dir/common/threads.cpp.o
[  2%] Building CXX object _deps/openal-build/CMakeFiles/OpenAL.dir/al/auxeffectslot.cpp.o
[  2%] Building CXX object _deps/openal-build/CMakeFiles/OpenAL.dir/al/buffer.cpp.o
[  2%] Building CXX object _deps/openal-build/CMakeFiles/OpenAL.dir/al/effect.cpp.o
[  2%] Building CXX object _deps/openal-build/CMakeFiles/OpenAL.dir/al/error.cpp.o
[  4%] Building CXX object _deps/openal-build/CMakeFiles/OpenAL.dir/al/event.cpp.o
[  4%] Building CXX object _deps/openal-build/CMakeFiles/OpenAL.dir/al/extension.cpp.o
[  4%] Building CXX object _deps/openal-build/CMakeFiles/OpenAL.dir/al/filter.cpp.o
/home/travis/build/ArthurSonzogni/smk/build/_deps/openal-src/al/filter.cpp: In constructor ‘{anonymous}::filter_exception::filter_exception(ALenum, const char*, ...)’:
/home/travis/build/ArthurSonzogni/smk/build/_deps/openal-src/al/filter.cpp:63:5: error: ‘va_start’ was not declared in this scope
     va_start(args, msg);
     ^~~~~~~~
/home/travis/build/ArthurSonzogni/smk/build/_deps/openal-src/al/filter.cpp:63:5: note: suggested alternative: ‘__sqrt’
     va_start(args, msg);
     ^~~~~~~~
     __sqrt
/home/travis/build/ArthurSonzogni/smk/build/_deps/openal-src/al/filter.cpp:64:5: error: ‘va_copy’ was not declared in this scope
     va_copy(args2, args);
     ^~~~~~~
/home/travis/build/ArthurSonzogni/smk/build/_deps/openal-src/al/filter.cpp:72:5: error: ‘va_end’ was not declared in this scope
     va_end(args2);
     ^~~~~~
/home/travis/build/ArthurSonzogni/smk/build/_deps/openal-src/al/filter.cpp:72:5: note: suggested alternative: ‘rand’
     va_end(args2);
     ^~~~~~
     rand

I don't have time tonight. I will take a look tomorrow if you don't.

ArthurSonzogni commented 4 years ago

Likely this patch: https://github.com/kcat/openal-soft/commit/c83609277bed4be4ef40ed306bf2c57fefa19519

The line:

#include <stdarg.h>     /* va_list, va_start, va_arg, va_end */

is needed.

I will submit a patch tonight.

kcat commented 4 years ago

Already fixed with commit 8713bb8afbe0fe42e531ec17c5ea0bb20af64126.

ArthurSonzogni commented 4 years ago

You are too quick ;-)

I have a patch: https://github.com/kcat/openal-soft/pull/414

Feel free to accept or reject. It adds the header to every other files using va_start. My compile problem was in filter.cpp, but there are still a 3 other files where was missing, even if it doesn't trigger any compile errors.

ArthurSonzogni commented 4 years ago

My build succeed thanks to 8713bb8 https://travis-ci.com/github/ArthurSonzogni/smk/builds/159872541