Skip to content

Commit c303b45

Browse files
committed
Fix GCC 14 stringop-overflow warning in date library
- Updated buffer size calculation in read function to use unsigned long long - Changed cast to unsigned long long for safer bounds checking - Added changelog entry documenting the fix - Resolves warning on Raspberry Pi Compute Module 5 with GCC 14
1 parent 13d0db0 commit c303b45

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

docs/changelog.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
4545
- **Impact**: Split check interface now provides clean, simple, and functional experience with clear visual feedback, proper pricing display, and intuitive manual item selection
4646

4747
### Fixed
48+
- **Fixed GCC 14 Warning in Date Library (2026-01-25)**
49+
- Resolved stringop-overflow warning in external/date/include/date/date.h when compiling on Raspberry Pi Compute Module 5 with GCC 14
50+
- **Changes Made**:
51+
- Changed buffer size calculation from std::numeric_limits<unsigned>::digits10+2u to std::numeric_limits<unsigned long long>::digits10+2u
52+
- Updated cast from static_cast<unsigned>(a0) to static_cast<unsigned long long>(a0)
53+
- **Root Cause**: GCC 14's enhanced bounds checking detected potential out-of-bounds access in the read function's buffer
54+
- **Solution**: Used unsigned long long type for safer buffer sizing
55+
- **Files modified**: external/date/include/date/date.h
56+
- **Impact**: Eliminates compiler warning without changing functionality
57+
4858
- **Removed Automatic Creation of System Page -94 (2026-01-23)**
4959
- Eliminated the automatic creation of page -94 (Index with Tabs template) that was causing "Can't delete page -94" errors
5060
- **Changes Made**:

external/date/include/date/date.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6502,8 +6502,8 @@ read(std::basic_istream<CharT, Traits>& is, int a0, Args&& ...args)
65026502
{
65036503
if (a0 != -1)
65046504
{
6505-
auto u = static_cast<unsigned>(a0);
6506-
CharT buf[std::numeric_limits<unsigned>::digits10+2u] = {};
6505+
auto u = static_cast<unsigned long long>(a0);
6506+
CharT buf[std::numeric_limits<unsigned long long>::digits10+2u] = {};
65076507
auto e = buf;
65086508
do
65096509
{

0 commit comments

Comments
 (0)