Bug#892087: libsdl2-dev: SDL_cpuinfo.h provokes warnings if used with -Wundef on non-x86 hosts

Peter Maydell peter.maydell at linaro.org
Mon Mar 5 10:19:16 UTC 2018


Package: libsdl2-dev
Version: 2.0.8+dfsg1-1
Severity: normal

Dear Maintainer,

The SDL2 header SDL_cpuinfo.h generates gcc warnings if the program using
it compiles with the -Wundef warning. (In particular, this means that QEMU
builds using it fail on at least sparc hosts, since QEMU dev builds
use both -Wundef and -Werror.) Here's a repro case:

$ cat qemu-conf.c
#include <SDL.h>
#undef main /* We don't want SDL to override our main() */
int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
$ cc -Wundef -o zz9.o -I /usr/include/SDL2 -c qemu-conf.c
In file included from /usr/include/SDL2/SDL.h:38:0,
                 from qemu-conf.c:1:
/usr/include/SDL2/SDL_cpuinfo.h:63:5: warning: "HAVE_IMMINTRIN_H" is not defined, evaluates to 0 [-Wundef]
 #if HAVE_IMMINTRIN_H && !defined(SDL_DISABLE_IMMINTRIN_H)
     ^~~~~~~~~~~~~~~~

This probably only causes problems on non-x86 hosts, because on x86
hosts SDL_config.h will do "#define HAVE_IMMINTRIN_H 1".

It would be nice if the headers could be compiled cleanly with this
warning flag enabled.

thanks
-- PMM

-- System Information:
Debian Release: buster/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'unreleased'), (1, 'experimental')
Architecture: sparc64

Kernel: Linux 4.15.0-rc8-sparc64-smp (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages libsdl2-dev depends on:
ii  libasound2-dev     1.1.3-5
ii  libdbus-1-dev      1.12.6-2
ii  libegl1-mesa-dev   17.3.6-1
ii  libgl1-mesa-dev    17.3.6-1
ii  libgles2-mesa-dev  17.3.6-1
ii  libglu1-mesa-dev   9.0.0-2.1+b1
ii  libibus-1.0-dev    1.5.17-3
ii  libpulse-dev       11.1-4
ii  libsdl2-2.0-0      2.0.8+dfsg1-1
ii  libsndio-dev       1.1.0-3
ii  libudev-dev        237-4
ii  libwayland-dev     1.14.0-2
ii  libx11-dev         2:1.6.4-3
ii  libxcursor-dev     1:1.1.15-1
ii  libxext-dev        2:1.3.3-1+b2
ii  libxi-dev          2:1.7.9-1
ii  libxinerama-dev    2:1.1.3-1+b3
ii  libxkbcommon-dev   0.8.0-1
ii  libxrandr-dev      2:1.5.1-1
ii  libxss-dev         1:1.2.2-1+b2
ii  libxt-dev          1:1.1.5-1+b1
ii  libxv-dev          2:1.0.11-1
ii  libxxf86vm-dev     1:1.1.4-1+b2

libsdl2-dev recommends no packages.

libsdl2-dev suggests no packages.

-- no debconf information



More information about the Pkg-sdl-maintainers mailing list