...
| Code Block | ||||
|---|---|---|---|---|
| ||||
#include <string.h>
void func(const char *src) {
/* Validate the source string; calculate size */
char *dest;
/* malloc destination string */
memcpy(dest, src,
#ifdef PLATFORM1
12
#else
24
#endif
/* ... */
);
|
Compliant
...
Solution
In this compliant solution [GCC Bugs], the appropriate call to memcpy() is determined outside the function call:
...