Skip to content

A fixed argument may be a header constant or sizeof of a header type; zlib, bzip2 and xz facts (#3173, spec v7.80) - #3526

Merged
ehartford merged 8 commits into
mainfrom
fixed-name-sizeof
Nov 22, 2026
Merged

ehartford merged 8 commits into
mainfrom
fixed-name-sizeof

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Eric's ruling of 2026-11-21 on #3173 (the two fixed forms; then the registry facts), with the blessed words.

The forms (§31 fixed_value = literal | CONST | "sizeof" "(" type ")", §16.2b.11):

  • param p fixed NAME: a constant the imported header defines. Text goes only to a C string parameter; an integer constant must fit the parameter.
  • param p fixed sizeof(T): T is a type the header declares; the parameter is an integer that holds the size.
  • An in-place initializer may take fixed arguments. It was refused as "not modeled" (Facade refusals don't say what to write: an agent following the spec guessed the grammar for an hour #3129's message). Two error tests asserted that limit (err_3129_initializer_fixed_argument, err_c_facade_help_fixed_argument_on_initializer); they are replaced by behav_c_facade_initializer_fixed_argument, which shows it working. A preinit still takes none.
  • A facts file states them on the item of a by-value resource's function.

Registry facts, each line cited from the package with get pins, and each proven by running a program against the pinned library:

  • zlib 1.4: Inflater and Deflater over z_stream; inflateInit_ and its kin pass ZLIB_VERSION and sizeof(z_stream) (the header's own macros do). Both return Z_OK, which zlib only does when the version and size are right. The existing gz citations are updated from 1.3.2 to the pinned 1.4.
  • bzip2 1.0.8: Compressor and Decompressor over bz_stream, cited from the package's own bzlib.c (the header has no prose); a bad block size returns Err.
  • xz 5.8.4: Stream over lzma_stream with an encoder and a decoder initializer; a bad check type returns Err.
    Each file also cites why zeroed storage is valid and what a failed initializer leaves behind.

Report fixes found on the way: a function a registry resource names was reported "raw", and was missing from the report entirely for a package linked as a prebuilt binary. zlib's report now lists nine functions, nine presented.

Tests: behav_c_facade_fixed_constant_and_sizeof, five err_c_facade_fixed_*, behav_c_facade_initializer_fixed_argument, conan_facade_inplace_fixed_facts_test.

The §31 table row still reads param p fixed literal; it is a normative row and is left for Eric.

Battery green; :release-checks green. #3173 stays open: the survey rerun and the draft proofs A and B follow.

Eric Hartford added 8 commits November 21, 2026 18:54
…an imported type: param p fixed NAME, param p fixed sizeof(T) (#3173; zlib's initializers)
…am p fixed V on its fn item (#3173; zlib's initializers take the header's version and the stream's size)
…rom the pinned 1.4 header: Inflater and Deflater over z_stream, their initializers passing ZLIB_VERSION and sizeof(z_stream) (#3173)
…nes, or sizeof of a type the header declares (Eric, 2026-11-21)
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.

1 participant