This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Flexible array member initializers
- From: Ãngel GonzÃlez <keisial at gmail dot com>
- To: Ian Pilcher <arequipeno at gmail dot com>
- Cc: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Thu, 09 Jan 2014 00:23:39 +0100
- Subject: Re: Flexible array member initializers
- Authentication-results: sourceware.org; auth=none
- References: <laimok$i1$1 at ger dot gmane dot org> <CAH6eHdTFnTYHLokRdGQ=ErFF=BubM5_aVb-vPhmGoWGd+YxWug at mail dot gmail dot com> <52CDB80F dot 2080807 at gmail dot com>
On 08/01/14 21:41, Ian Pilcher wrote:
Ideally I could create some sort of generic macro that "casts" (using
the term very loosely) any static initializer to an array of unsigned
char that contains its binary representation. Sadly, I don't think
that's actually possible.
I think you want to use an union, not a flexible array (yes, you will
overallocate for some types, but should be saner).