Skip to content

D208: a process domain names its writers; a writer's call is checked against every linked contract (#3127) - #3436

Merged
ehartford merged 9 commits into
bare-callbackfrom
static-buffer-return
Nov 18, 2026
Merged

ehartford merged 9 commits into
bare-callbackfrom
static-buffer-return

Conversation

@ehartford

@ehartford ehartford commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Closes #3127. Implements spec v7.60 §16.2b.7 (D208) as Eric ruled it on 2026-11-18.

  • Grammar. domain D process written by f, g or written by any; a process domain with neither is an error with a fix-it. preserves domain D at a contract's own level says the library's own threads do not rewrite D.
  • The rule. Functions a domain does not name preserve it. A call of a named writer of a domain some function returns a view of is safe where every call of the writers and of the view-returning functions is provably on one thread, and every linked contract says runs no threads or preserves domain D. Otherwise E0921.
  • Both acceptance programs: a view held on one thread while another calls the writer is refused; main holding the version text while a task calls another function of the library is accepted.
  • The compiler's libc contract says runs no threads, environ … written by setenv, unsetenv, putenv, clearenv, _putenv, _putenv_s and strerror_text … written by strerror. getenv is no writer (Eric, 2026-11-18): POSIX.1-2024 requires its pointer to point into the environment data. A writer the program did not import is left out by the checker.
  • Drafter. A function that returns its own static array is drafted as domain f process written by f with returns borrow CStr from domain f.
  • The runtime's contracts say written by any, which changes nothing in their behaviour; naming their writers (and deleting about 550 preserves lines) is a follow-up.
  • uat/libcurl.uat gains the two lines Eric approved: preserves domain version_info and the writer list on its domain.
  • Census. One allowance row: the contract-level preserves domain item joins the FACADE_CLAUSE_* table.

Not in this PR: the derived spec words (the written by grammar, the contract-level preserves domain line, the §16.2b.7 example), which wait on Eric.

Battery green on the stack's top (2be269f); UAT 12 pass, 1 skip; :release-checks green.

Eric Hartford added 9 commits November 18, 2026 11:54
… static buffer is a view of the library's process domain, under the C-global rule (#3127)
…ve a viewed process domain is checked; a domain may name its writers
…rs or says any; a writer's call is checked against every linked contract
…riters; the toolchain contract's view gains the thread line
@ehartford
ehartford added this pull request to stack #3438 November 18, 2026 20:37
@ehartford ehartford changed the title static buffer return D208: a process domain names its writers; a writer's call is checked against every linked contract (#3127) Nov 18, 2026
@ehartford
ehartford marked this pull request as ready for review November 18, 2026 20:37
@ehartford
ehartford merged commit a144d11 into main Nov 18, 2026
@ehartford
ehartford deleted the static-buffer-return branch November 18, 2026 20:37
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.

Facade proof: curl_version returns a static buffer it rewrites on each call; raw as "a pointer to no record"

1 participant