8000 fix all compilation warnings by aleflm · Pull Request #1618 · firoorg/firo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix all compilation warnings #1618

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
be1b6da
Fix doxygen warnings by modifying comments
aleflm May 15, 2025
6fa39ca
Fix preprocessor-related warnings by refactoring preprocessor directives
aleflm May 15, 2025
bb0e624
Fix Wsuggest-override by adding override to virtual functions.
aleflm May 15, 2025
da06bef
Fix Wmaybe-uninitialized by Initialize variables to default values
aleflm May 15, 2025
723ead5
Fix various warnings in code
aleflm May 15, 2025
eb79159
Fix Wimplicit-fallthrough by using custom macro (FIRO_FALLTHROUGH)
aleflm May 15, 2025
0bcd4bf
Fix Wredundant-decls by using the main declaration.
aleflm May 15, 2025
5f67a7c
Fix Wunused-* by creating a custom macro (FIRO_UNUSED) for labeling u…
aleflm May 15, 2025
cba459e
Fix Wshadow by renaming member variables/parameters in derived class.
aleflm May 15, 2025
1e9bbff
Fix Wpedantic (anonymous class/unions) by naming them.
aleflm May 15, 2025
c6eb2aa
Refactor CMakeLists.txt files to use CMAKE_CURRENT_SOURCE_DIR for sou…
aleflm May 15, 2025
ff1e106
Fix Wthread-safety by removing or adding a lock.
aleflm May 15, 2025
380653f
Fix type related warnings like Wsign-compare, Wignored-qualifiers and…
aleflm May 15, 2025
7b30287
Fix Wstring-int-plus by using std::to_string function.
aleflm May 15, 2025
6ce5117
Fix Wcast-function by explicitly cast them with reinterpret_cast.
aleflm May 15, 2025
17a5471
Fix Wdeprecated-declarations by using snprintf instead of printf.
aleflm May 15, 2025
17faa3f
Fix various minor warnings
aleflm May 18, 2025
9f90a21
Merge branch 'master' into dev-aleflm-fix-all-warnings
aleflm Jun 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,38 @@ foreach(func ${BUILTIN_FUNCTIONS})
endif()
endforeach()

check_cxx_source_compiles(
"#if __cplusplus >= 201703L
int main() {
[[maybe_unused]] int x = 42;
return 0;
}
#else
#error \"Requires C++17\"
#endif"
HAVE_MAYBE_UNUSED
)
if(${HAVE_MAYBE_UNUSED})
message(STATUS "Compiler supports maybe_unused" )
add_compile_definitions(HAVE_MAYBE_UNUSED=1)
else()
message(WARNING "Compiler does not support maybe_unused")
check_cxx_source_compiles(
"int main() {
__attribute__((unused)) int x = 42;
return 0;
}"
HAVE_ATTRIBUTE_UNUSED
)
if(${HAVE_ATTRIBUTE_UNUSED})
message(STATUS "Compiler supports __attribute__((unused))" )
add_compile_definitions(HAVE_ATTRIBUTE_UNUSED=1)
else()
message(WARNING "Compiler does not support __attribute__((unused))")
message(WARNING "Please use a compiler that supports C++17 or __attribute__((unused))")
endif()
endif()

include(cmake/ccache.cmake)

add_library(warn_interface INTERFACE)
Expand Down Expand Up @@ -837,6 +869,8 @@ add_maintenance_targets()
add_windows_deploy_target()
add_macos_deploy_target()

include_directories(${CMAKE_SOURCE_DIR}/src)

message("\n")
message("Configure summary")
message("=================")
Expand Down
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

ACLOCAL_AMFLAGS = -I build-aux/m4
SUBDIRS = src
AM_CPPFLAGS = -I$(top_srcdir)/src
.PHONY: deploy FORCE
.INTERMEDIATE: $(OSX_TEMP_ISO)

Expand Down
22 changes: 22 additions & 0 deletions cmake/module/AddBoostIfNeeded.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,28 @@ function(add_boost_if_needed)
# Define the macro if the test passed
if(HAVE_WORKING_BOOST_SLEEP_FOR)
add_compile_definitions(HAVE_WORKING_BOOST_SLEEP_FOR=1)
else()
# testing for boost::this_thread::sleep(boost::posix_time::milliseconds(n));
set(SLEEPTEST_SOURCE_CODE "
#include <boost/thread/thread.hpp>
#include <boost/version.hpp>

int main() {
#if BOOST_VERSION >= 105000 && (!defined(BOOST_HAS_NANOSLEEP) || BOOST_VERSION >= 105200)
boost::this_thread::sleep(boost::chrono::milliseconds(0));
return 0;
#else
choke me
#endif
}
")
# Check if the test source code compiles
check_cxx_source_compiles("${SLEEPTEST_SOURCE_CODE}" HAVE_WORKING_BOOST_SLEEP)
if(HAVE_WORKING_BOOST_SLEEP)
add_compile_definitions(HAVE_WORKING_BOOST_SLEEP=1)
else()
message(FATAL_ERROR "Couldn't find a working boost sleep_for or sleep function. Please check your Boost.")
endif()
endif()

mark_as_advanced(Boost_INCLUDE_DIR)
Expand Down
Loading
Loading
0