Re: [PATCH kmod] shared/util.c: assert_cc() can only be used inside functions
From: Lucas De Marchi <hidden>
Date: 2017-06-05 08:04:46
From: Lucas De Marchi <hidden>
Date: 2017-06-05 08:04:46
On Sat, Jun 3, 2017 at 8:03 AM, Thomas Petazzoni [off-list ref] wrote:
shared/macro.h has two versions of assert_cc, one that uses gcc
_Static_assert(), which requires recent enough gcc versions, and one
that uses a fake array to trigger a build error. The latter can only
work inside functions, so assert_cc() should only be used inside
functions.
Fixes the following build failure when building kmod with old gcc
versions such as gcc 4.3.x:
shared/util.c:52: error: expected identifier or '(' before 'do'
shared/util.c:52: error: expected identifier or '(' before 'while'
Signed-off-by: Thomas Petazzoni <redacted>
---The changes look simple, but going forward I'd like to understand this. kmod requires C11 that contains _Static_assert(). Is there a compelling reason to support a compiler that old? GCC 4.3.0 has been released 9 years ago. Lucas De Marchi