diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2016-04-18 22:26:02 +0200 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2016-04-18 22:26:05 +0200 |
commit | 32ddd96972301a03dc0d594bda76da426785e722 (patch) | |
tree | 613d9d04382d201dd97282bd35cd1f7346a070ba /includes | |
parent | 87114ae13fd1f10dc00a6b4e64898da3e92d0266 (diff) | |
download | haskell-32ddd96972301a03dc0d594bda76da426785e722.tar.gz |
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
Diffstat (limited to 'includes')
-rw-r--r-- | includes/Rts.h | 9 | ||||
-rw-r--r-- | includes/rts/storage/Closures.h | 20 | ||||
-rw-r--r-- | includes/rts/storage/InfoTables.h | 4 | ||||
-rw-r--r-- | includes/rts/storage/TSO.h | 2 |
4 files changed, 13 insertions, 22 deletions
diff --git a/includes/Rts.h b/includes/Rts.h index 6f4f33effc..1ad1bba5f8 100644 --- a/includes/Rts.h +++ b/includes/Rts.h @@ -41,15 +41,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 #define ATTRIBUTE_ALIGNED(n) /*nothing*/ diff --git a/includes/rts/storage/Closures.h b/includes/rts/storage/Closures.h index 2ce1a27b23..f880b5c876 100644 --- a/includes/rts/storage/Closures.h +++ b/includes/rts/storage/Closures.h @@ -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 */ diff --git a/includes/rts/storage/InfoTables.h b/includes/rts/storage/InfoTables.h index 228369b22f..3de63c8516 100644 --- a/includes/rts/storage/InfoTables.h +++ b/includes/rts/storage/InfoTables.h @@ -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; diff --git a/includes/rts/storage/TSO.h b/includes/rts/storage/TSO.h index 9bddfcafbd..aa3d05745b 100644 --- a/includes/rts/storage/TSO.h +++ b/includes/rts/storage/TSO.h @@ -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 |