[bug] alsa-tools-1.1.3 compilation fails with clang due to wrong inline declaration.

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

 



I've tried compiling alsa-tools-1.3.0 with clang, and the compilation
fails with the following:

$ CC=clang CXX=clang++ make
./as10k1
<...snip...>
clang -fno-strict-aliasing -O2 -Wall -pipe -g   -o as10k1 as10k1.o
parse.o assemble.o macro.o 
as10k1.o: In function `header':
/home/moxian/work/alsa-tools/alsa-tools-1.1.3/as10k1/as10k1.c:524:
undefined reference to `output_tram_line'
/home/moxian/work/alsa-tools/alsa-tools-1.1.3/as10k1/as10k1.c:527:
undefined reference to `output_tram_line'
/home/moxian/work/alsa-tools/alsa-tools-1.1.3/as10k1/as10k1.c:539:
undefined reference to `output_tram_line'
/home/moxian/work/alsa-tools/alsa-tools-1.1.3/as10k1/as10k1.c:543:
undefined reference to `output_tram_line'
clang-3.9: error: linker command failed with exit code 1 (use -v to see
invocation)
make[2]: *** [Makefile:320: as10k1] Error 1
make[2]: Leaving directory
'/home/moxian/work/alsa-tools/alsa-tools-1.1.3/as10k1'
make[1]: *** [Makefile:354: all-recursive] Error 1
make[1]: Leaving directory
'/home/moxian/work/alsa-tools/alsa-tools-1.1.3/as10k1'
make: *** [Makefile:9: all] Error 1

Clang devs claim that it is not a bug in clang (as I thought
originally), but rather invalid code, which happens to compile with gcc
by accident. This is due to `output_tram_line` function being declared
as `inline void output_tram_line`. The intent was probably to declare it
as `static inline void output_tram_line`.
Please see https://bugs.llvm.org/show_bug.cgi?id=33768 for more details.

Adding `static` to the function definition makes everything compile (at
least everything that compiles with gcc already).
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux