nothings / stb

stb single-file public domain libraries for C/C++

Home Page:https://twitter.com/nothings

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

stb_image_resize2.h: 'asm' is not recognized keyword in '-std=c99' mode

fp64 opened this issue · comments

commented

stb_image_resize2.h fails to compile under -std=c99:
https://godbolt.org/z/aYbKdzGzj

It works fine in -std=gnu99, and also in C++. Technically, asm keyword is an extension to C Standard (but "conditionally-supported and implementation defined" part of C++ Standard proper):
https://en.cppreference.com/w/c/language/asm
https://en.cppreference.com/w/cpp/language/asm

The fix is simple: replace asm with __asm__, which should work in all __GNUC__ compilers.
I'd imagine -std=c99 is common enough to justify the fix.

fixed