-
Notifications
You must be signed in to change notification settings - Fork 66
Open
Description
str1 = whatever;
if (strlen(str1) == 0) return whatever;
char str2[strlen(str1)+ 1];
strcpy(str2, str1);
whatever
becomes something like
str1 = whatever;
if (strlen(str1) == 0) return whatever;
{ char str2[strlen(str1)+ 1];
strcpy(str2, str1);
whatever
}
It could be done near-properly by using alloca, i.e. _alloca (for MSVC):
str1 = whatever;
if (strlen(str1) == 0) return whatever;
{ char* str2 = _alloca(strlen(str1) + 1);
strcpy(str2, str1);
whatever
}
In case it was a concious decision not to Support VLA, then this should be mentioned in the readme.
In general it would be helpful if known limits of c99-to-c89 were documented, at least roughly.
That said, it is still a more than helpful tool. Thanks for creating it!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels