https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82167

--- Comment #1 from felix <felix.von.s at posteo dot de> ---
Hmm, never mind my question, I found one way to do it...

#define NO_SIZEOF_WARNING(expr) ({ \
                _Pragma("GCC diagnostic push") \
                _Pragma("GCC diagnostic ignored \"-Wsizeof-array-argument\"") \
                __typeof__((expr)) _value = (expr); \
                _Pragma("GCC diagnostic pop") \
                _value; \
        })

Not the most concise code ever, but it works.

Reply via email to