Question on rtems printf problem

groups at chichak.ca groups at chichak.ca
Tue Dec 20 05:49:10 UTC 2022


On 2022-December-19, at 19:59, tianye at sugon.com <mailto:tianye at sugon.com> wrote:
> 
> Hi:
> 	I have a testcode, it will lead to uart print space forever.
> 
> Demo code like this:
> 	Init()
> 	{
> 		create a task;
> 		start this task;
> 		printf("%*\n");
>                 while(1) { 
> 			sleep()
> 		}
> 	}

What are you expecting get? The * tells printf that there will be a parameter following that will give you the length of the subsequent parameter. Usually of the format %*s, length, string.
I’m pretty sure that you don’t have a proper format string, it’s missing the item that you should be specifying the length for and then you neither have the length nor the item to be printed.

What are you trying to do?


A


---------------------
Andrei Chichak

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20221219/2fc85492/attachment-0001.htm>


More information about the users mailing list