[FEATURE REQUEST] avr: maximal string length settable
Original Reporter info from Mantis: georghieber
-
Reporter name: Georg Hieber
Original Reporter info from Mantis: georghieber
- Reporter name: Georg Hieber
Description:
In each procedure (including main) the compiler allocates space for temporary variables on the stack. If these temps include strings, 256 bytes are allocated for each of them.
On the small controllers that only have ½ or 1k of RAM, this more or less precludes the use of strings. On the other side, in the typical applications for these chips, strings usually are something like: 'ready in ' + xy + 'minutes', and the maximal string length is known to the programmer.
It would therefore desireable to be able to tell the compiler how much space to allocate for these temps, or, what is the default length of the type shortstring. This could be done by a compiler directive like
{$SHORTSTRINGLENGTH xy}
This would, of course, also affect declared string variables, but with these al least one has the option to declare them as strings with a given maximal length.
Mantis conversion info:
- Mantis ID: 32073
- OS: embedded
- Platform: avr
- Version: 3.1.1
- Monitored by: » @d.ioannidis (Dimitrios Chr. Ioannidis)