Conversation
Lua.h uses std::string (the Arg class), assert(), and uint8_t but relied on transitive includes via <mutex>/<vector> to provide them. That worked under gcc 8 but breaks under gcc 14, where <string> is no longer pulled in transitively, causing compile failures in downstream projects. Include the headers directly so Lua.h is self-contained.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Lua.huses several standard-library facilities without including the headers that declare them:std::string— used throughout theArgclass (constructors, them_strValunion member,getStrVal())assert()— used ingetStrVal()/getIntVal()/getFloatVal()uint8_t— used for theArg::Typeenum's underlying typeThese currently resolve only through transitive includes pulled in by
<mutex>and<vector>. That happens to work with the libstdc++ shipped in the Arduino-ESP32 2.x core (gcc 8), but breaks with newer toolchains. Under gcc 14 (pioarduino),<string>is no longer included transitively, so building against this header fails with errors like'string' is not a member of 'std'.Downstream projects have had to work around this by force-including
<string>from a PlatformIO extra script.Fix
Include the required headers directly in
Lua.hso it is self-contained and no longer depends on the include graph of unrelated standard headers:<string><cassert><cstdint>Also tidied a stray leading space on the first
#includeline.No functional change — this only makes the existing dependencies explicit.