Change to calculate the symbol value deterministically and at compile time in the same way as previous multi-character implementation. The newly added function multichars_to_uint32 was tested in both gcc and clang.
Fix the following warnings:
/home/lh/work/leap-main/tests/abieos/src/template_test.cpp:230:25: warning: multi- character character constant [-Wmultichar]
230 | test(symbol{unsigned('ZYX\x08')}, abi, new_abi);
| ^~~~~~~~~
/home/lh/work/leap-main/tests/abieos/src/template_test.cpp:231:30: warning: multi- character character constant [-Wmultichar]
231 | test(symbol_code{unsigned('ZYXW')}, abi, new_abi);
| ^~~~~~
/home/lh/work/leap-main/tests/abieos/src/template_test.cpp:232:25: warning: multi- character character constant [-Wmultichar]
232 | test(asset{5, symbol{'ZYX\x08'}}, abi, new_abi);
| ^~~~~~~~~
Thanks for your comment! That's my thought too, as the function is only intended for the 3 test cases immediately follows. I did not want to clutter the code.
Multi-character is not defined by C++ standard and is implementation-defined: https://en.cppreference.com/w/cpp/language/character_literal.
Change to calculate the symbol value deterministically and at compile time in the same way as previous multi-character implementation. The newly added function
multichars_to_uint32
was tested in bothgcc
andclang
.Fix the following warnings: