8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 12:43:02 +01:00

Make return-type a compilation error (#8362)

This protects from undefined behavior cases that can be added to the code by mistake.
This commit is contained in:
Ilya Eremin 2024-12-26 14:38:50 +03:00 committed by GitHub
parent fa83e793d1
commit 566bebf2d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 1 deletions

View File

@ -111,7 +111,7 @@ GLOB_OPTIONS:=
#____________________________________________________________________________
# Global c++ flags: firebird needs no RTTI, choose build standard and c++ specific warnings level
PLUSPLUS_FLAGS:= -fno-rtti -std=c++17 -Werror=delete-incomplete
PLUSPLUS_FLAGS:= -fno-rtti -std=c++17 -Werror=delete-incomplete -Werror=return-type
# If this is defined then we use special rules useful for developers only
IsDeveloper = @DEVEL_FLG@

View File

@ -28,6 +28,7 @@
<UseFullPaths>false</UseFullPaths>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<TreatSpecificWarningsAsErrors>4715</TreatSpecificWarningsAsErrors>
</ClCompile>
<Link>
<SuppressStartupBanner>true</SuppressStartupBanner>

View File

@ -1124,6 +1124,7 @@ namespace
return twelveHours == 12 ? twelveHours : 12 + twelveHours;
cb->err(Arg::Gds(isc_incorrect_hours_period) << string(period.data(), period.length()));
return 0; // suppress compiler warning/error
}
constexpr int roundYearPatternImplementation(int parsedRRValue, int currentYear)