-
Notifications
You must be signed in to change notification settings - Fork 464
[core] Try out a boost::format replacement. #5234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: fruffy <fruffy@nyu.edu>
f974dc3
to
5e2c1f2
Compare
5e2c1f2
to
ad0acb0
Compare
Signed-off-by: fruffy <fruffy@nyu.edu>
frontends/common/constantParsing.cpp
Outdated
@@ -77,7 +77,7 @@ int parseConstantChecked(const Util::SourceInfo &srcInfo, const UnparsedConstant | |||
auto cst = parseConstant(srcInfo, constant, 0); | |||
if (!cst->fitsInt()) { | |||
::P4::error(ErrorType::ERR_OVERLIMIT, | |||
"%1$x: this implementation does not support bitstrings this large", cst); | |||
"%1%: this implementation does not support bitstrings this large", cst); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes from printing the bitstring a hex to printing it as decimal, which seems less useful. Is there a way to have boost::formatter print in hex?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
%x
should give hex printing if using the abseil formatter. Not quite clear how to migrate smoothly here...
The problem here in particular is that cst is a IR::Constant pointer and the operator<<
for it doesn't generate hex. And, according to the reference files, this output already generated decimal format: https://github.com/p4lang/p4c/blob/main/testdata/p4_16_errors_outputs/width_e.p4-stderr#L1
ad0acb0
to
a961fbf
Compare
a961fbf
to
8a65ab7
Compare
8a65ab7
to
a1c3278
Compare
Signed-off-by: fruffy <fruffy@nyu.edu>
a1c3278
to
221f1eb
Compare
Signed-off-by: fruffy <fruffy@nyu.edu>
No description provided.