GNOME Bugzilla – Bug 462805
[alsa] compilation fails with gcc 4.2
Last modified: 2007-09-19 12:19:00 UTC
When using gcc 4.2, build the alsa plugin raises the following warning:
gstalsadeviceprobe.c:64: warning: the address of 'info' will always evaluate as 'true'
The reason is because that line is :
and snd_ctl_card_info_alloca is in fact a macro which would expand as follow (based on the above line):
info = (snd_ctl_card_info_t *) alloca(snd_ctl_card_info_sizeof());
memset(info, 0, snd_ctl_card_info_sizeof());
The problem is the assert(&info); since info was defined just above, it's guaranteed that the address of 'info' will always evaluate as 'true'.
To fix that:
* either fix the alsa headers to have 'hassert (ptr != NULL);'
* Add -Wno-address to the CFLAGS
Has this been reported to https://bugtrack.alsa-project.org/alsa-bug/ ?
This has been fixed, I think:
2007-09-15 David Schleef <email@example.com>
Change alsa alloca's to malloc to fix warnings on gcc-4.2.
I don't think this is a good fix. Filed a bug for alsa:
Should I reopen this?