Commit 32ddd969 authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺 Committed by Ben Gamari

Remove obsolete/redundant FLEXIBLE_ARRAY macro

This macro is doubly redundant, first off all, ancient GCCs prior to
version 3.0 are not supported anymore, but more importantly, we require
a ISO C99 compliant compiler, so we can use the proper ISO C syntax
without worrying about compatibility.

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: carter, thomie

Differential Revision: https://phabricator.haskell.org/D2121
parent 87114ae1
......@@ -40,15 +40,6 @@ extern "C" {
#include "rts/Types.h"
#if __GNUC__ >= 3
/* Assume that a flexible array member at the end of a struct
* can be defined thus: T arr[]; */
#define FLEXIBLE_ARRAY
#else
/* Assume that it must be defined thus: T arr[0]; */
#define FLEXIBLE_ARRAY 0
#endif
#if __GNUC__ >= 3
#define ATTRIBUTE_ALIGNED(n) __attribute__((aligned(n)))
#else
......
......@@ -79,12 +79,12 @@ typedef struct {
typedef struct StgClosure_ {
StgHeader header;
struct StgClosure_ *payload[FLEXIBLE_ARRAY];
struct StgClosure_ *payload[];
} *StgClosurePtr; // StgClosure defined in rts/Types.h
typedef struct {
StgThunkHeader header;
struct StgClosure_ *payload[FLEXIBLE_ARRAY];
struct StgClosure_ *payload[];
} StgThunk;
typedef struct {
......@@ -97,7 +97,7 @@ typedef struct {
StgHalfWord arity; /* zero if it is an AP */
StgHalfWord n_args;
StgClosure *fun; /* really points to a fun */
StgClosure *payload[FLEXIBLE_ARRAY];
StgClosure *payload[];
} StgPAP;
typedef struct {
......@@ -105,14 +105,14 @@ typedef struct {
StgHalfWord arity; /* zero if it is an AP */
StgHalfWord n_args;
StgClosure *fun; /* really points to a fun */
StgClosure *payload[FLEXIBLE_ARRAY];
StgClosure *payload[];
} StgAP;
typedef struct {
StgThunkHeader header;
StgWord size; /* number of words in payload */
StgClosure *fun;
StgClosure *payload[FLEXIBLE_ARRAY]; /* contains a chunk of *stack* */
StgClosure *payload[]; /* contains a chunk of *stack* */
} StgAP_STACK;
typedef struct {
......@@ -138,21 +138,21 @@ typedef struct StgBlockingQueue_ {
typedef struct {
StgHeader header;
StgWord bytes;
StgWord payload[FLEXIBLE_ARRAY];
StgWord payload[];
} StgArrBytes;
typedef struct {
StgHeader header;
StgWord ptrs;
StgWord size; // ptrs plus card table
StgClosure *payload[FLEXIBLE_ARRAY];
StgClosure *payload[];
// see also: StgMutArrPtrs macros in ClosureMacros.h
} StgMutArrPtrs;
typedef struct {
StgHeader header;
StgWord ptrs;
StgClosure *payload[FLEXIBLE_ARRAY];
StgClosure *payload[];
} StgSmallMutArrPtrs;
typedef struct {
......@@ -241,7 +241,7 @@ typedef struct {
StgMutArrPtrs *ptrs; /* a pointer to a MutArrPtrs */
StgHalfWord arity; /* arity of this BCO */
StgHalfWord size; /* size of this BCO (in words) */
StgWord bitmap[FLEXIBLE_ARRAY]; /* an StgLargeBitmap */
StgWord bitmap[]; /* an StgLargeBitmap */
} StgBCO;
#define BCO_BITMAP(bco) ((StgLargeBitmap *)((StgBCO *)(bco))->bitmap)
......@@ -261,7 +261,7 @@ typedef struct {
const StgInfoTable* info;
StgWord size;
StgClosure * fun;
StgClosure * payload[FLEXIBLE_ARRAY];
StgClosure * payload[];
} StgRetFun;
/* Concurrent communication objects */
......
......@@ -125,7 +125,7 @@ extern StgWord16 closure_flags[];
*/
typedef struct {
StgWord size;
StgWord bitmap[FLEXIBLE_ARRAY];
StgWord bitmap[];
} StgLargeBitmap;
/* -----------------------------------------------------------------------------
......@@ -206,7 +206,7 @@ typedef struct StgInfoTable_ {
*/
#ifdef TABLES_NEXT_TO_CODE
StgCode code[FLEXIBLE_ARRAY];
StgCode code[];
#endif
} *StgInfoTablePtr;
......
......@@ -191,7 +191,7 @@ typedef struct StgStack_ {
StgWord32 stack_size; // stack size in *words*
StgWord32 dirty; // non-zero => dirty
StgPtr sp; // current stack pointer
StgWord stack[FLEXIBLE_ARRAY];
StgWord stack[];
} StgStack;
// Calculate SpLim from a TSO (reads tso->stackobj, but no fields from
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment