Download

Compiler strictness across platforms is inconsistent

Hi,

I’m not sure anything can be done about this, but I’m finding that compiling on platforms other than PC is showing up small problems in our code. The compilers for Mac and PS4 seem to treat more things as errors. For example we had this piece of code:


Result == FString::FromInt(MenuItem->SelectedMultiChoice);

Obviously that is supposed to be an assignment not a comparison, but it happily compiled on PC. I didn’t get an error until I compiled for PS4.

Is there any way to get strictness parity between all the platforms or is it just a case of different compilers being different?

Cheers,

Ryan.

Hello.

This line of code is perfectly valid in C++, so a successful compilation isn’t a suprise.
Of course, the == statement has absolutely no effect, and your compiler may issue a warning. For example, g++ will warn for this with -Wall, and Visual C++ warns with /W1. Your compiler may also treat these warnings as errors, which is probably why your project doesn’t compile for PS4.
To get all of this working the same way everywhere, you’ll have to dig in your compilers settings and make the relevant changes.

Regards.