There is no explicit conversion at all in your code.
STRING_TEST
is a macro, so the statement
test(STRING_TEST);
is preprocessed into
test("Test String");
which will then be compiled.
"Test String"
is a string literal, so when passed to a function will be IMPLICITLY converted to a const char *
.
So, assuming your compiler complies with the standard, the statement will not compile (since implicit conversion from const char *
(or from a string literal to char *
) is not permitted.
However, some compilers do allow this implicit conversion (for reasons of backward compatibility to older versions of C). Those compilers can often be made to complain by cranking up diagnostics (e.g. with Microsoft compilers adding the /Wall
command line option).