newlib STRING_ONLY, what is it good for?

Asked by Martin Velek

Hello,

I am trying to reduce the newlib streamio complexity (stack use) and in the source code of the newlib-nano library I have discovered settings -DSTRING_ONLY. What is good for? There is no solid info about this symbol. I want to use C99 so the nano is not an option for me.

BR
Martin

Question information

Language:
English Edit question
Status:
Solved
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Solved by:
Martin Velek
Solved:
Last query:
Last reply:
Revision history for this message
Martin Velek (martin-velek) said :
#1

With this option I am unable to link files containing printf, fprintf, .... because of undefined reference to `_vfprintf_r. I assume the STRING_ONLY causes to disable using of any formatted function writtting to i/o stream including stdin,stdout, etc.

Revision history for this message
Launchpad Janitor (janitor) said :
#2

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Tejas Belagod (belagod-tejas) said :
#3

I can't seem to find much information on STRING_ONLY except its usage in sources. Best to ping on the newlib list <email address hidden> upstream.

Revision history for this message
Martin Velek (martin-velek) said :
#4

I got it. The STRING_ONLY should not be normally set during compilation of the newlib library (-DSTRING_ONLY). The newlib shares the data string formatting functions between the I/O (like fprintf) and string functions (like snprintf). During compilation the make script compile the common file without -DSTRING_ONLY to include file locking/stream buffering and later on the same file is compiled with -DSTRING_ONLY to remove the i/o code. I was wondering why debugger is jumping into the same file and location while using fprintf and snprintf.