obscene
Member
Going through an extremely annoying problem.
Sure. String comparisons are not efficient. But when you're doing something quick and dirty that only gets called one time, why care. It's easier than making enums for every damn little thing. But, when using the YYC and only on Linux, these result in errors like this....
Game/gml_Script_scr_hint_get.gml.cpp:187:103: warning: comparison of array 'g_pString7287_C8D69341' not equal to a null pointer is always true [-Wtautological-pointer-compare]
if (( (___sw7286___.GetString() == g_pString7287_C8D69341) || ((___sw7286___.GetString() != NULL) && (g_pString7287_C8D69341 != NULL) && (strcmp( ___sw7286___.GetString(), g_pString7287_C8D69341 ) == 0)))) {
^~~~~~~~~~~~~~~~~~~~~~ ~~~~
I'm 100% sure the only problem is that it's a string. I've been going through these and either changing them to enums or just using if/else statements and knocking these errors out. But it's annoying. I have alot of them. And I can't help but think there's a checkbox somewhere I can click to tell the compiler "stfu this works on windows and mac."
Code:
switch (something)
{
case "some_string":
do stuff
break;
}
Game/gml_Script_scr_hint_get.gml.cpp:187:103: warning: comparison of array 'g_pString7287_C8D69341' not equal to a null pointer is always true [-Wtautological-pointer-compare]
if (( (___sw7286___.GetString() == g_pString7287_C8D69341) || ((___sw7286___.GetString() != NULL) && (g_pString7287_C8D69341 != NULL) && (strcmp( ___sw7286___.GetString(), g_pString7287_C8D69341 ) == 0)))) {
^~~~~~~~~~~~~~~~~~~~~~ ~~~~
I'm 100% sure the only problem is that it's a string. I've been going through these and either changing them to enums or just using if/else statements and knocking these errors out. But it's annoying. I have alot of them. And I can't help but think there's a checkbox somewhere I can click to tell the compiler "stfu this works on windows and mac."