cfe-dev Digest, Vol 60, Issue 109

Exactly, which makes this sort of a self-inflicted wound. So, why bother specifying N in the array declaration? It’s not like you’re using std::array. One idea is to come at the problem a different way:

#define NEW_ARRAY(TYPE_, NAME_, SIZE_, ...) \
   TYPE_ NAME_ = {__VA_ARGS__}; \
   static_assert ((sizeof (NAME_) / sizeof (TYPE_)) == SIZE_, "")

Now just go through and replace your array declarations once, and you’ll never have this problem again.

      Steve