Skip to content

_vprintk incorrectly prints 64-bit values #7179

Closed
@d3zd3z

Description

@d3zd3z

_vprintk and by extension all of the formatted print routines in Zephyr support "%lld" and variants to print 64-bit values. However, the code that does this discards the top 32-bits of these values, and just prints them using the 32-bit printing code:

                                long d;
                                if (long_ctr < 2) {
                                        d = va_arg(ap, long);
                                } else {
                                        d = (long)va_arg(ap, long long);
                                }

This could be fixed by by generalizing the print routines to use 64-bit values, although there could be a performance cost to this affecting all of the print routines. However, the current behavior is misleading, and we'd probably be better printing something like "ERR" rather than printing incorrect values.

Metadata

Metadata

Assignees

Labels

area: MiscellaneousbugThe issue is a bug, or the PR is fixing a bugpriority: lowLow impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions