You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The C and C++ standards specify that the signature for main requires argv to be modifiable.[1][2] For example: int main(int argc, char* argv[]). In particular, declaring argv const is non-portable.
If main is declared as above, then calling Catch::Session::applyCommandLine produces an error in MSVC, gcc and clang.
The C and C++ standards specify that the signature for
main
requires argv to be modifiable.[1][2] For example:int main(int argc, char* argv[])
. In particular, declaring argv const is non-portable.If
main
is declared as above, then callingCatch::Session::applyCommandLine
produces an error in MSVC, gcc and clang.MSVC 2015:
gcc:
clang:
Here's a sandbox to experiment with:
http://melpon.org/wandbox/permlink/bFwLOVsdbBMkOmUh
Proposed Fix
Change the signature of
applyCommandLine
andparseInto
as follows:This change fixes the issue in MSVC, and should do so in gcc and clang also, based on the sandbox test above.
[1] http://stackoverflow.com/questions/2108192/what-are-the-valid-signatures-for-cs-main-function
[2] http://stackoverflow.com/questions/11216155/is-int-mainint-char-const-const-well-formed
The text was updated successfully, but these errors were encountered: