We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4103

Summary: SDL_cpuinfo.h provokes warnings with -Wundef on non-x86 hosts
Product: SDL Reporter: Felix Geyer <debfx>
Component: *don't know*Assignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.0   
Hardware: Other   
OS: Linux   

Description Felix Geyer 2018-03-05 19:35:13 UTC
Forwarding from https://bugs.debian.org/892087 quoting verbatim:

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.).

/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
Comment 1 Sam Lantinga 2018-03-11 05:20:51 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/a358a111ff69