Skip to content

Include time header for RTC with modern C++ toolchains - #314

Closed
stdstijn wants to merge 1 commit into
SolderedElectronics:masterfrom
stdstijn:fix/rtc-cpp23-time-header
Closed

stdstijn wants to merge 1 commit into
SolderedElectronics:masterfrom
stdstijn:fix/rtc-cpp23-time-header

Conversation

@stdstijn

@stdstijn stdstijn commented Sep 29, 2026 •

Copy link
Copy Markdown

Summary

  • Include <ctime> explicitly in the RTC implementation, which uses tm, time_t, localtime, and mktime.
  • Avoid depending on those declarations arriving through unrelated headers when compiling with newer C++ toolchains.

Verification

  • In an isolated Inkplate 6COLOR PlatformIO build using Arduino and the GCC 12.2.0 Xtensa toolchain with -std=gnu++23, the build failed on missing time declarations before this include and completed after adding it.
  • Compile-only validation; no on-device tests. This is a focused compatibility fix, not a claim that every library example/board supports all C++23 features.

The RTC implementation uses tm, time_t, localtime, and mktime but relies on transitive includes to declare them. Newer C++ standard libraries do not supply these declarations transitively, so include <ctime> explicitly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@stdstijn
stdstijn marked this pull request as ready for review September 29, 2026 19:40
@stdstijn stdstijn closed this Sep 29, 2026
@stdstijn
stdstijn deleted the fix/rtc-cpp23-time-header branch September 29, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant