Skip to content

About print information bug #2558

Answered by tt4g
adrian-yehe asked this question in Q&A
Nov 29, 2022 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Your syntax of fmt library is wrong. Replace last syntax 0x{0:x} with 0x{:#02d} for padding left.

-#define SMMU_VER_MAJOR (3) #define SMMU_VER_MINOR (0) #define SMMU_VER_PATCH (1) spdlog::info("Welcome to SMMU version 0x{0:x}.{0:d}.0x{0:x} !", SMMU_VER_MAJOR, SMMU_VER_MINOR, SMMU_VER_PATCH);
+#define SMMU_VER_MAJOR (3) #define SMMU_VER_MINOR (0) #define SMMU_VER_PATCH (1) spdlog::info("Welcome to SMMU version 0x{0:x}.{0:d}.0x{:#02d} !", SMMU_VER_MAJOR, SMMU_VER_MINOR, SMMU_VER_PATCH);

See fmt syntax: https://fmt.dev/9.0.0/syntax.html

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@adrian-yehe
Comment options

Answer selected by adrian-yehe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants