Skip to content

c_import: present a function-like macro that is a single call with constant arguments #3516

Closed

Description

@ehartford

From Eric's ruling on #3173 (2026-11-21).

zlib's real initializers take two parameters only the header's macro supplies: inflateInit(strm) is inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)), and deflateInit, inflateInit2 and deflateInit2 have the same shape (pinned zlib.h, lines 1913 to 1950). A contract today must name inflateInit_ and fix both parameters (param version fixed ZLIB_VERSION, param stream_size fixed sizeof(z_stream), ruled the same day).

The header's macro already says exactly what to pass. If c_import presented a function-like macro whose body is a single call with constant arguments, a contract could name inflateInit itself and need no fixed lines.

To find out first: how much of this the importer does today (it already types object-like macros), and how many macros of this shape the surveyed libraries have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions