[DiscordArchive] what could cause a C++ program to have some bugs when compiled by someone else ?
[DiscordArchive] what could cause a C++ program to have some bugs when compiled by someone else ?
Archived author: Titi • Posted: 2022-12-22T19:43:02.195000+00:00
Original source
what could cause a C++ program to have some bugs when compiled by someone else ?
eintemporel's builds of noggit red have some issues with what I believe to be wrongly initialised variables, if I build it I don't have any of those bugs.
Could like a compiler default integers to 0(mine) and another to some random value ?
Archived author: Nix • Posted: 2022-12-22T19:45:59.720000+00:00
Original source
Compiler version
Archived author: Nix • Posted: 2022-12-22T19:46:01.895000+00:00
Original source
Different compiler
Archived author: Nix • Posted: 2022-12-22T19:46:03.796000+00:00
Original source
Compiler flags
Archived author: Titi • Posted: 2022-12-22T20:11:31.442000+00:00
Original source
if so would defaulting all the values in the header files fix it for all compilers ?
Archived author: Nix • Posted: 2022-12-22T20:16:26.565000+00:00
Original source
It could yes
Archived author: Nix • Posted: 2022-12-22T20:16:32.680000+00:00
Original source
Especially between debug & release builds
Archived author: Nix • Posted: 2022-12-22T20:16:40.421000+00:00
Original source
In debug all variables are usually auto intialized
Archived author: Nix • Posted: 2022-12-22T20:16:42.152000+00:00
Original source
but not in release
Archived author: Skarn • Posted: 2022-12-23T07:13:16.443000+00:00
Original source
If something behaves differently under different compilers or release vs debug, that means there is undefined behavior in the code somewhere