Compilation failure on Windows
Created by: tavianator
This line and many similar ones give the following error: https://github.com/ovalhub/pyicu/blob/76de5c969e7e0855a3e301264a73a8ca8db50356/locale.cpp#L569
locale.cpp(569): error C2446: ':': no conversion from 'int' to 'charsArg'
locale.cpp(569): note: No constructor could take the source type, or constructor overload resolution was ambiguous
locale.cpp(576): error C2446: ':': no conversion from 'int' to 'charsArg'
locale.cpp(576): note: No constructor could take the source type, or constructor overload resolution was ambiguous
locale.cpp(589): error C2446: ':': no conversion from 'int' to 'charsArg'
locale.cpp(589): note: No constructor could take the source type, or constructor overload resolution was ambiguous
locale.cpp(600): error C2446: ':': no conversion from 'int' to 'charsArg'
locale.cpp(600): note: No constructor could take the source type, or constructor overload resolution was ambiguous
locale.cpp(610): error C2446: ':': no conversion from 'int' to 'charsArg'
locale.cpp(610): note: No constructor could take the source type, or constructor overload resolution was ambiguous
I believe these errors are correct in general, and only compile with gcc due to compiler extensions. C++ allows NULL
to expand to 0
(and actually prohibits it from being (void *)0
like it can in C). So we have something like
charsArg keywords;
... kwds != NULL ? keywords : NULL ...
keywords
is a charsArg
which has an operator const char *()
, but since NULL
is an int
that conversion won't be considered. I think nullptr
would work instead of NULL
, for example, or an explicit cast.