The following line of code that creates an array of variable length on the stack:
char name[cpfs_params(cfdata->cpfs)->namemax + 1] = {'\0'};
Creates the following compiler diagnostics:
src / mount.cpfs / cpfsfuse.c: 179: error: variable object cannot be initialized
src / mount.cpfs / cpfsfuse.c: 179: warning: redundant items in an array initializer
src / mount.cpfs / cpfsfuse.c: 179: warning: (near initialization for the name)
What options are available for initializing VLA? I am forced to use a string, for example:
memset(name, 0, sizeof(name));
Instead
source
share