Skip to content

[generate-macro-bindings]: Allow ignoring non-value macros #697

@minichma

Description

@minichma

generate-macro-bindings only supports value-like macros today. When specifying the option, binding fails, if the source code contains any non-value-like macros with diagnostics like

Function like macro definition records are not supported: '<MACRO NAME>'. Generated bindings may be incomplete.

Source code often contains both, value-like as well as non-value-like macros. Even if binding of non-value-like is not supported, it would still be very helpful if we could easily bind just the value-like ones, without applying workarounds like listing all the non-value-like ones in order to exclude them.

Feature request

This is a feature request to allow binding just value-like macros while ignoring non-value-like ones.

Suggested solution

Variant A

Introduce an option like exclude-non-value-macros. If it is specified, any non-value-like macros would be excluded from the binding process. So if specified together with generate-macro-bindings, only the value-like macros would be translated.

Variant B

Allow ignoring certain diagnostics, in this case Generated bindings may be incomplete.

Variant C

Introduce an option like generate-value-macro-bindings that just refers to value-like macros while ignoring any non-value-like ones.

Variant D

Generally ignore non-value-like macros when applying generate-macro-bindings. Not sure, that's an option, but assuming that non-value-like ones will not be supported any time soon, the meaning of the option could maybe be redefined to just translate value-like macros. Should non-value-like ones be supported in the future, a separate option could be introduced for those.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions