Open Bug 1659612 Opened 4 years ago Updated 3 years ago

--enable-alsa fails -Werror=implicit-function-declaration on FreeBSD

Categories

(Core :: Audio/Video: cubeb, defect, P3)

Unspecified
FreeBSD
defect

Tracking

()

Tracking Status
firefox79 --- unaffected
firefox80 --- affected

People

(Reporter: jbeich, Unassigned)

References

(Regression)

Details

(Keywords: regression)

ALSA backend is also supported on DragonFly (but not PulseAudio) and FreeBSD. alloca (unlike snprintf) is not compatible with _XOPEN_SOURCE. Possible workarounds: mark ALSA headers as system or mark bundled libcubeb as AllowCompilerWarnings().

$ echo 'ac_add_options --enable-alsa' >>.mozconfig
$ ./mach build
[...]
media/libcubeb/src/cubeb_alsa.c:613:9: error: implicitly declaring library function 'snprintf' with type 'int (char *, unsigned int, const char *, ...)' [-Werror,-Wimplicit-function-declaration]
    r = snprintf(node_name, sizeof(node_name), "pcm.%s", string);
        ^
media/libcubeb/src/cubeb_alsa.c:613:9: note: include the header <stdio.h> or explicitly provide a declaration for 'snprintf'
media/libcubeb/src/cubeb_alsa.c:1168:3: error: implicitly declaring library function 'alloca' with type 'void *(unsigned int)' [-Werror,-Wimplicit-function-declaration]
  snd_pcm_hw_params_alloca(&hw_params);
  ^
/usr/local/include/alsa/pcm.h:737:39: note: expanded from macro 'snd_pcm_hw_params_alloca'
#define snd_pcm_hw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_hw_params)
                                      ^
/usr/local/include/alsa/global.h:106:57: note: expanded from macro '__snd_alloca'
#define __snd_alloca(ptr,type) do { *ptr = (type##_t *) alloca(type##_sizeof()); memset(*ptr, 0, type##_sizeof()); } while (0)
                                                        ^
media/libcubeb/src/cubeb_alsa.c:1168:3: note: include the header <stdlib.h> or explicitly provide a declaration for 'alloca'
/usr/local/include/alsa/pcm.h:737:39: note: expanded from macro 'snd_pcm_hw_params_alloca'
#define snd_pcm_hw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_hw_params)
                                      ^
/usr/local/include/alsa/global.h:106:57: note: expanded from macro '__snd_alloca'
#define __snd_alloca(ptr,type) do { *ptr = (type##_t *) alloca(type##_sizeof()); memset(*ptr, 0, type##_sizeof()); } while (0)
                                                        ^
2 errors generated.
Severity: -- → S3
Priority: -- → P3
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.