Re:Undefined behavior can result in time travel
by Karellen on Saturday June 28, 2014 @02:39PM
(#7958909)
"There is no portable way to check whether the parameter is a string constant"
Well, the compiler should warn you if you try to pass a (char const *) to a function expecting a (char *). Use -Wwrite-strings to make string literals have type (char const[]) rather than (char[]).
Well, the compiler should warn you if you try to pass a (char const *) to a function expecting a (char *). Use -Wwrite-strings to make string literals have type (char const[]) rather than (char[]).