Skip to content

Add public print method that takes va_list instead of a variable number of arguments#41

Draft
pennam wants to merge 1 commit intoarduino-libraries:masterfrom
pennam:va_list
Draft

Add public print method that takes va_list instead of a variable number of arguments#41
pennam wants to merge 1 commit intoarduino-libraries:masterfrom
pennam:va_list

Conversation

@pennam
Copy link
Copy Markdown
Contributor

@pennam pennam commented Jan 23, 2024

I was tryng to improve SE05X library and get rid of this buffer used only for debugging purpose. To this i wanted to reuse Arduino_DebugUtils library.

SE05X NXP internal library already has builtin debug macros and is written in C so i cannot directly call Arduino_DebugUtils.print function as macro substitution, but i need to create a wrapper CPP function with varargs that calls the Arduino_DebugUtils.print method.

What i've found out is that is not possible to call a function which takes a variable number of arguments and passes them to some other function (which takes a variable number of arguments) so the proposal to add a new method that takes va_list

Probably another option is to use a variadic function template or using __builtin_apply but i did not investigate them and i think the proposed option is more straightforward.

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Jan 23, 2024
@github-actions
Copy link
Copy Markdown

Memory usage change @ 1cd099e

Board flash % RAM for global variables %
arduino:avr:mega 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
Click for full report table
Board examples/Arduino_Debug_Basic
flash
% examples/Arduino_Debug_Basic
RAM for global variables
% examples/Arduino_Debug_Advance
flash
% examples/Arduino_Debug_Advance
RAM for global variables
%
arduino:avr:mega 0 0.0 0 0.0 0 0.0 0 0.0
Click for full report CSV
Board,examples/Arduino_Debug_Basic<br>flash,%,examples/Arduino_Debug_Basic<br>RAM for global variables,%,examples/Arduino_Debug_Advance<br>flash,%,examples/Arduino_Debug_Advance<br>RAM for global variables,%
arduino:avr:mega,0,0.0,0,0.0,0,0.0,0,0.0

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 4, 2026

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: code Related to content of the project itself type: enhancement Proposed improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants