After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 462805 - [alsa] compilation fails with gcc 4.2
[alsa] compilation fails with gcc 4.2
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: 0.10.15
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Reported: 2007-08-02 14:31 UTC by Edward Hervey
Modified: 2007-09-19 12:19 UTC
See Also:
GNOME target: ---
GNOME version: ---

Description Edward Hervey 2007-08-02 14:31:29 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 : 
snd_ctl_card_info_alloca (&info);

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
Comment 1 Stefan Sauer (gstreamer, gtkdoc dev) 2007-08-05 14:12:48 UTC
Has this been reported to ?
Comment 2 Tim-Philipp Müller 2007-09-18 09:20:09 UTC
This has been fixed, I think:

 2007-09-15  David Schleef  <>

        * ext/alsa/gstalsa.c:
        * ext/alsa/gstalsadeviceprobe.c:
        * ext/alsa/gstalsamixer.c:
        * ext/alsa/gstalsasink.c:
        * ext/alsa/gstalsasrc.c:
          Change alsa alloca's to malloc to fix warnings on gcc-4.2.

Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2007-09-19 12:19:00 UTC
I don't think this is a good fix. Filed a bug for alsa:

Should I reopen this?