Hello Pirmin,

> If I try to format some data in a anligned string with  
> Genode::snprintf(), the data is stored in the string, but my  
> additional format specifier for the field width aren't respected.
> 
> My string is:
> 
> static const char* lineFormat = "%5d  \"%25s\"  \"%25s\" %10s %5d\r\n"

Genode's format-string functions are limited to the few use cases
present in the base framework. I.e., it is sufficient for simple tasks
like printing a number or concatenating strings but it is not meant as a
full-fledged POSIX compliant formatting utility. If you need a complete
format-string implementation, I recommend you to use the libc instead.

> If I do want to right align the numbers (%-5d) the function crashes my  
> program.

This should not happen. Thank you for reporting. I just opened an issue
about it:

  https://github.com/genodelabs/genode/issues/1485

> The comment on the functoin doesn't specify that format sizes arn't supported.

I keep a note to cover this information in the upcoming documentation.
For now, please let me refer you to the implementation. I think the code
is pretty self-explanatory. If not, please don't hesitate to ask.


https://github.com/genodelabs/genode/blob/master/repos/base/src/base/console/console.cc

Best regards
Norman

-- 
Dr.-Ing. Norman Feske
Genode Labs

http://www.genode-labs.com · http://genode.org

Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
genode-main mailing list
genode-main@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/genode-main

Reply via email to