summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2019-10-04 09:22:04 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2019-10-28 10:00:31 +0100
commit7ec08391fee73d7a25855089f4996f3c4f448007 (patch)
tree2c92ee5f3569fe93a2d93a6dced09a98a43938c1
parentconfig: Avoid zero-length array (diff)
downloadrtems-7ec08391fee73d7a25855089f4996f3c4f448007.tar.bz2
linkersets: Avoid use of zero-length array
Use RTEMS_DEFINE_GLOBAL_SYMBOL_IN_SECTION() instead.
-rw-r--r--cpukit/include/rtems/linkersets.h34
1 files changed, 22 insertions, 12 deletions
diff --git a/cpukit/include/rtems/linkersets.h b/cpukit/include/rtems/linkersets.h
index bad046999c..4a23d7a696 100644
--- a/cpukit/include/rtems/linkersets.h
+++ b/cpukit/include/rtems/linkersets.h
@@ -28,14 +28,19 @@ extern "C" {
_Linker_set_##set##_end
#define RTEMS_LINKER_ROSET_DECLARE( set, type ) \
- extern type const RTEMS_LINKER_SET_BEGIN( set )[0]; \
- extern type const RTEMS_LINKER_SET_END( set )[0]
+ extern type const RTEMS_LINKER_SET_BEGIN( set )[]; \
+ extern type const RTEMS_LINKER_SET_END( set )[]
#define RTEMS_LINKER_ROSET( set, type ) \
- type const RTEMS_LINKER_SET_BEGIN( set )[0] \
- RTEMS_SECTION( ".rtemsroset." #set ".begin" ) RTEMS_USED; \
- type const RTEMS_LINKER_SET_END( set )[0] \
- RTEMS_SECTION( ".rtemsroset." #set ".end" ) RTEMS_USED
+ RTEMS_LINKER_ROSET_DECLARE( set, type ); \
+ RTEMS_DEFINE_GLOBAL_SYMBOL_IN_SECTION( \
+ RTEMS_LINKER_SET_BEGIN( set ), \
+ ".rtemsroset." #set ".begin" \
+ ); \
+ RTEMS_DEFINE_GLOBAL_SYMBOL_IN_SECTION( \
+ RTEMS_LINKER_SET_END( set ), \
+ ".rtemsroset." #set ".end" \
+ )
#define RTEMS_LINKER_ROSET_ITEM_DECLARE( set, type, item ) \
extern type const _Linker_set_##set##_##item
@@ -59,14 +64,19 @@ extern "C" {
RTEMS_SECTION( ".rtemsroset." #set ".content" )
#define RTEMS_LINKER_RWSET_DECLARE( set, type ) \
- extern type RTEMS_LINKER_SET_BEGIN( set )[0]; \
- extern type RTEMS_LINKER_SET_END( set )[0]
+ extern type RTEMS_LINKER_SET_BEGIN( set )[]; \
+ extern type RTEMS_LINKER_SET_END( set )[]
#define RTEMS_LINKER_RWSET( set, type ) \
- type RTEMS_LINKER_SET_BEGIN( set )[0] \
- RTEMS_SECTION( ".rtemsrwset." #set ".begin" ) RTEMS_USED; \
- type RTEMS_LINKER_SET_END( set )[0] \
- RTEMS_SECTION( ".rtemsrwset." #set ".end" ) RTEMS_USED
+ RTEMS_LINKER_RWSET_DECLARE( set, type ); \
+ RTEMS_DEFINE_GLOBAL_SYMBOL_IN_SECTION( \
+ RTEMS_LINKER_SET_BEGIN( set ), \
+ ".rtemsrwset." #set ".begin" \
+ ); \
+ RTEMS_DEFINE_GLOBAL_SYMBOL_IN_SECTION( \
+ RTEMS_LINKER_SET_END( set ), \
+ ".rtemsrwset." #set ".end" \
+ )
#define RTEMS_LINKER_RWSET_ITEM_DECLARE( set, type, item ) \
extern type _Linker_set_##set##_##item