This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Newlib snprintf_lite storing info string to flash

GNU toolchain 5.4 2016q3 in use and compiling c/c++ project to M4. Compiling with --specs=nano.specs flag so Newlib nano is in use.

I am working to optimize code and looking output binary data to clean all unwanted read-only constant string out of my project. I noticed following string:
"not enough space for format expansion (Please submit full bug report at http://gcc.gnu.org/bugs.html)"

Searching map file and found this string is coming from "arm-none-eabi/lib/armv7e-m/fpu\libstdc++_nano.a(snprintf_lite.o)"
This is really something I don't want to be stored in any memory. Project is not having exceptions and flag -fno-exceptions is in use. 
String is there even compiling for size using -Os flag.

My question: Is it possible to drop that string out from flash?


 

Parents
  • Everything defined in newlib can be redefined in your application.

    namespace __gnu_cxx {
    
    int __snprintf_lite(char *__buf, size_t __bufsize, const char *__fmt,
                        va_list __ap) {}
    
    }    // namespace __gnu_cxx

    This safes 486 bytes on my machine.

Reply
  • Everything defined in newlib can be redefined in your application.

    namespace __gnu_cxx {
    
    int __snprintf_lite(char *__buf, size_t __bufsize, const char *__fmt,
                        va_list __ap) {}
    
    }    // namespace __gnu_cxx

    This safes 486 bytes on my machine.

Children
No data