I am working in a platform with limited flash memory, and I recently hit the wall and tried to reduce the ReadOnly area. and strings used in printf seemed to be a good place to start. while doing this I came across the following code snippet. and I happened to find that the following reuses "failed" for multiple prints ( looking at the executable). where as normal printf doesn't do this optimization even when the same string parts are used. is there any optimization options in GCC (GCC 4.8.4) which can lead to less storage space for debug strings?
#define printf_failed(str) printf("%s failed", str); // reuses failed