[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: libobjc2: Dealing with non-constant initializers in sarray2.h includ
From: |
David Chisnall |
Subject: |
Re: libobjc2: Dealing with non-constant initializers in sarray2.h included from C files |
Date: |
Tue, 6 Sep 2016 16:24:45 +0100 |
On 6 Sep 2016, at 15:35, Ivan Vučica <address@hidden> wrote:
>
> Cheers,
>
> I'm fiddling with writing Bazel (http://www.bazel.io/) BUILD-files for
> libobjc2 (and, hopefully, other GS libraries). There are reasons why I'm
> doing this, but they're a separate discussion topic.
>
> There's this:
>
> In file included from dtable.h:3:0,
> from category_loader.c:5:
> sarray2.h: At top level:
> sarray2.h:26:1: error: initializer element is not constant
> static const uint32_t data_mask = data_size - 1;
> ^
> sarray2.h:55:8: error: variably modified 'data' at file scope
> void *data[data_size];
> ^
>
>
> This is on GCC 4.8.4. I guess I can pass -x c++, but that feels wrong. Any
> suggestions?
Report a bug with GCC? data_size is a const int, and so data_size - 1 is an
integer constant expression according to the C standard, and is a valid
initialiser.
David