13-09-2016, 09:11 AM
I've been faced with the same issue and I choosed kinda 3):
public header:
module:
Anybody any idea about this?
public header:
Code:
enum SIZES
{
...,
MAX_USER_NAME = 64U,
MAX_GROUP_NAME_ = 32U,
MAX_USERS = 256U,
...
};
// Note: This does not violate any rules, especially not the ODR!
module:
Code:
void myFunc()
{
...
char_t userList[ MAX_USERS ][ MAX_USER_NAME ];
// IMHO this does NOT violate 4-5-2. LDRA is known for some false positives.
for ( size_t idx = 0U; idx < static_cast( MAX_USERS ); idx++ )
{
userList[ idx ][ 0U ] = '\0';
}
...
}
Anybody any idea about this?