RIOT icon indicating copy to clipboard operation
RIOT copied to clipboard

core: add stdio.h to replace stdout functions with stdio_null

Open benpicco opened this issue 1 year ago • 1 comments

Contribution description

So far stdio_null would just drop the stdio backend, all the expensive stdio formatting functions were still included.

This PR replaces all calls to printf() and friends with a no-op.

Testing procedure

Build e.g. tests/minimal which uses stdio_null:

master

   text	   data	    bss	    dec	    hex	filename
   9256	    108	   1312	  10676	   29b4	/home/benpicco/dev/RIOT-2/tests/minimal/bin/same54-xpro/tests_minimal.elf

this PR

   text	   data	    bss	    dec	    hex	filename
   5140	    108	   1312	   6560	   19a0	/home/benpicco/dev/RIOT/tests/minimal/bin/same54-xpro/tests_minimal.elf

Issues/PRs references

benpicco avatar Sep 26 '24 14:09 benpicco

Murdock results

:heavy_check_mark: PASSED

f840d80473f22d76f41158e771bec5c67f9c9e56 cpu/avr8_common: don't implement perror() with stdio_null

Success Failures Total Runtime
10287 0 10287 11m:53s

Artifacts

riot-ci avatar Sep 27 '24 08:09 riot-ci

How do we proceed here?

benpicco avatar Jan 16 '25 16:01 benpicco

Wait for the end of the feature freeze, then merge?

maribu avatar Jan 16 '25 17:01 maribu

How do we proceed here?

In the last VMA, there was agreement on using #include_next, so I guess this is good to proceed. According to the notes, @maribu volunteered to open a PR reflecting the discussion in the coding convention, that is still pending, afaict.

mguetschow avatar Jan 17 '25 09:01 mguetschow

Thx for the reminder; here is the PR: https://github.com/RIOT-OS/RIOT/pull/21140

maribu avatar Jan 19 '25 21:01 maribu

With the feature freeze past, #21140 in and one approval present, I think we can go on and merge.

mguetschow avatar Jan 22 '25 10:01 mguetschow

Ping :wink:

benpicco avatar Feb 11 '25 11:02 benpicco