Thread (5 messages) 5 messages, 2 authors, 2017-06-06

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

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help