Re: [EE] Saving "printf" arguments for later? Real-time on slow processor.

peter green <[email protected]>
Newsgroups gmane.comp.hardware.microcontrollers.pic
Message-ID <[email protected]>
On 16/01/2025 21:45, Jason White wrote:
> I've reached the conclusion that my best bet is to write a wrapper for
> printf.
> The wrapper would save the printf format string, and variadic arguments to
> a buffer so that I can process the printfs later when the CPU is idle.
> I think I can get away with this since all of the printfs just contain
> numbers and short (~8 byte) strings.

Unfortunately the nature of variadics in C is that no type information
is passed to the receiving function. So you have to perform at least
some basic parsing of the format string to determine the parameter
types you are working with.

Not nessacerally a showstopper, but something to bear in mind.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.