Bugzilla – Bug 2916
Command Line Parser treats uint8_t as char
Last modified: 2020-05-04 09:53:44 EDT
The CommandLine parser treats uint8_t as char. Therefore uint8_t variables get treated unintuitively.
Steps to Reproduce:
1) Create a script that uses a uint8_t command line argument:
main (int argc, char *argv)
uint8_t seed = 0;
cmd.AddValue ("value", "Some Explanation", seed);
cmd.Parse (argc, argv);
2) Run the script with the argument "--value=1"
cmd.Parse (argc, argv) sets seed to 49, because 49 is the ASCII value of character '1'.
cmd.Parse (argc, argv) should set seed to 1.
Build Date & Hardware:
ns-3.28 on Mac OS X High Sierra.
It would worth to port this one to Gitlab, I've faced this problem again.
Already there :) See