Skip to content

Conversation

@jviotti
Copy link
Member

@jviotti jviotti commented Dec 30, 2025

To address compiler string literal maximum interoperability lengths.

Signed-off-by: Juan Cruz Viotti jv@jviotti.com

@augmentcode
Copy link

augmentcode bot commented Dec 30, 2025

🤖 Augment PR Summary

Summary: This PR changes the jsonschema compile --include code generator to emit schema contents as a byte array instead of a single (potentially huge) C/C++ string literal.

Changes:

  • Generate static const unsigned char …_DATA[] with comma-separated 0xNN bytes (12 bytes per line) to avoid compiler string literal length limits.
  • Add #include <cstddef> for std::size_t in the generated C++ header.
  • Construct the generated std::string_view from the byte buffer via reinterpret_cast and an explicit size cast.
  • Update the compile include golden tests to match the new header output format.

Technical Notes: The generated header now represents the JSON as raw bytes rather than a concatenated string literal, improving interoperability across compilers with string literal size limits.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

@jviotti jviotti force-pushed the compile-include-array branch from 5b69bda to e666fb6 Compare December 30, 2025 17:50
To address compiler string literal maximum interoperability lengths.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti jviotti force-pushed the compile-include-array branch from e666fb6 to 2e6a3db Compare December 30, 2025 18:14
@jviotti jviotti merged commit b9d8584 into main Dec 30, 2025
12 checks passed
@jviotti jviotti deleted the compile-include-array branch December 30, 2025 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants