Conversation
Specification changes: - Generic entrypoint now takes a single void* to a versioned data object (contract_violation_data_v1) instead of 6 individual params - Versioning rules: first byte is version, new versions append only, old runtimes ignore unknown fields - TU-local wrappers construct the versioned struct on the stack and call the generic entrypoint - Field type enumerators renamed with __cxa_field_ prefix - Removed field_summary (unused) - Fixed section numbering (5.3 → 5.2) - Fixed undefined contract_violation_field_t → __cxa_field_type_t - Replaced accessor API with sample implementations showing both runtime entrypoint and compiler-emitted pseudocode - Fixed std::contract_violation → std::contracts::contract_violation - Added TODO for handler linkage specification Other changes: - Added rationale.rst (design rationale, separated from spec) - Tightened requirements.rst (removed filler sections) - Reorganized index.rst (spec first, background second)
Runtime-provided wrappers (§4.2) conflict with the versioning strategy: they construct the versioned struct internally, locked to the runtime's version. A newer compiler wanting to pass v2 data cannot do so through an old runtime's wrapper. Requiring the compiler to always construct the versioned struct preserves forward compatibility. - Removed section 4.2 (runtime wrapper entrypoints) - Renumbered 4.3 → 4.2 (compiler-generated wrappers) - Added observed-semantic wrapper example alongside enforced - Removed runtime wrapper from sample implementation (§6.1) - Documented rationale for compiler-only wrappers
Includes: - contracts_abi.h: ABI types (__cxa_source_location, descriptor table, etc.) - contracts_runtime.cpp: runtime entrypoint + sample std::contracts::contract_violation - main.cpp: simulated compiler-emitted code exercising observed and enforced semantics - Makefile for building with clang++ The runtime demonstrates the key ABI flow: walking the descriptor table, extracting fields from static data, and constructing contract_violation using source_location::__create_from_pointer (matching libc++ layout). Also cleans up spec_answers_to_open_questions.rst (remove LLM artifacts, fix broken cross-references).
- GitHub Actions workflow to build and run the example, verifying contract violations print to stderr and the enforced check aborts - Link to the example directory from section 6 of the spec - Add efcs/cxx-abi as a submodule for the Itanium ABI patch - Gitignore the example binary and remove it from tracking
Each ABI type and enumeration now gets its own subsection with a dedicated code block and prose description, closer to how entities are specified in the C++ standard. Also adds a README linking to contracts-abi.com, the example directory, and the Itanium ABI patch.
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.
No description provided.