mirror of
https://github.com/TheAlgorithms/C.git
synced 2026-02-08 13:54:41 +00:00
[PR #1530] [CLOSED] fix(build): Address various compiler warnings (ULL, const-correctness, Wformat) #2139
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/TheAlgorithms/C/pull/1530
Author: @jesper-olsen
Created: 11/18/2025
Status: ❌ Closed
Base:
master← Head:fix/compiler-warnings📝 Commits (1)
7fe7f16fix(build): Address various compiler warnings (ULL, const-correctness, Wformat)📊 Changes
2596 files changed (+139413 additions, -11 deletions)
View changed files
➕
CMakeCache.txt(+576 -0)➕
CMakeFiles/4.1.1/CMakeCCompiler.cmake(+84 -0)➕
CMakeFiles/4.1.1/CMakeDetermineCompilerABI_C.bin(+0 -0)➕
CMakeFiles/4.1.1/CMakeSystem.cmake(+15 -0)➕
CMakeFiles/4.1.1/CompilerIdC/CMakeCCompilerId.c(+934 -0)➕
CMakeFiles/4.1.1/CompilerIdC/apple-sdk.c(+1 -0)➕
CMakeFiles/CMakeConfigureLog.yaml(+3270 -0)➕
CMakeFiles/CMakeDirectoryInformation.cmake(+16 -0)➕
CMakeFiles/InstallScripts.json(+25 -0)➕
CMakeFiles/Makefile.cmake(+362 -0)➕
CMakeFiles/Makefile2(+7166 -0)➕
CMakeFiles/TargetDirectories.txt(+344 -0)➕
CMakeFiles/cmake.check_cache(+1 -0)➕
CMakeFiles/progress.marks(+1 -0)➕
CPackConfig.cmake(+82 -0)➕
CPackSourceConfig.cmake(+90 -0)➕
Makefile(+2899 -0)➕
audio/CMakeFiles/CMakeDirectoryInformation.cmake(+16 -0)➕
audio/CMakeFiles/alaw.dir/DependInfo.cmake(+23 -0)➕
audio/CMakeFiles/alaw.dir/alaw.c.o(+0 -0)...and 80 more files
📄 Description
Description of Change
Summary
This Pull Request addresses several compiler warnings found when compiling the repository with strict compiler flags (e.g., Clang 17.0.0 on macOS, which uses -Wall). These changes ensure better code quality, portability, and adherence to modern C standards without altering the functionality of the algorithms.
Specific Warnings Fixed
-Wimplicitly-unsigned-literal):ULLsuffix to large constants indecimal_to_any_base.candhash_djb2.c.-Wabsolute-value):fabsfto the double-precision functionfabsingeometry/vectors_3d.cbecause the variablealphais of typedouble.-Wincompatible-pointer-types-discards-qualifiers):(const int **)in themainfunction ofmodified_binary_search.cto match the function signature, resolving the const-discarding warning.-Wformat):scanfincollatz.cto%lluto correctly read into auint64_t.printfformat specifier inshell_sort2.cfrom%.4g(double) to%.4lu(unsigned long) for printingclock_tdifferences.prime_factoriziation.c(C99 style initialization inside theforloop).Thank you for reviewing!
Checklist
Notes:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.