don't add integers to string literals (#410)
* string literal + integer means unintended and incorrect pointer arithmetic fixes a clang warning. it could not be triggered, because it can only be triggered if the string given to getopt is not covered among the cases in the switch. * handle review comment
This commit is contained in:
parent
2caac2b218
commit
27293cc1c1
|
@ -126,7 +126,10 @@ struct option_struct {
|
|||
}
|
||||
break;
|
||||
default:
|
||||
exit_error("Unexpected argument " + c);
|
||||
// reaching here means an argument was given to getopt() which did not have a case label
|
||||
exit_error("Unexpected argument - missing case for option "+
|
||||
std::string(1,static_cast<char>(c))+
|
||||
" (programming error)");
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
|
Loading…
Reference in New Issue