Fix -Wreturn-type and its undefined behavior

Silence the following warning message:
src/NotesWriterSM.cpp:260:11: warning: control reaches end of non-void function [-Wreturn-type]

This warning had meaningful implications for some reason.
When I compiled the current version with stack protector enabled,
GCC optimized out successful return from the function, and encouraged
undefined behavior far less intuitive than an unspecified value.

Whenever saving a steps file on a -DCMAKE_BUILD_TYPE=Release build,
the game printed a message about stack protection violation,
and aborted itself, even though no violation took place.

GCC version:
gcc (Gentoo 10.2.0 p1) 10.2.0
This commit is contained in:
Arusekk
2020-07-28 21:30:09 +02:00
parent 1c869edab5
commit 74331b6b3c
+1 -1
View File
@@ -264,7 +264,7 @@ bool NotesWriterSM::Write( RString sPath, Song &out, const vector<Steps*>& vpSte
return false;
}
Write( f, out, vpStepsToSave );
return Write( f, out, vpStepsToSave );
}
bool NotesWriterSM::Write( RageFileBasic &f, Song &out, const vector<Steps*>& vpStepsToSave )