Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for function-like macros in the auditors sanity checks #500

Merged
merged 1 commit into from
Jun 29, 2024

Conversation

JamesWrigley
Copy link
Member

Fixes #499. The problem is that in one of the headers there are macros with the same names as struct types, e.g.:

// Line 29
#define lxb_css_syntax_token_delim(token) ((lxb_css_syntax_token_delim_t *) (token))

// Line 139
typedef struct lxb_css_syntax_token_delim {
    lxb_css_syntax_token_base_t base;
    lxb_char_t                  character;
}
lxb_css_syntax_token_delim_t;

We already check for these kinds of conflicts between structs and functions, but not structs and macro-like functions so the auditor failed. I think this ought to be fixed upstream by changing the struct definitions to use untagged structs like so:

typedef struct {
    lxb_css_syntax_token_base_t base;
    lxb_char_t                  character;
}
lxb_css_syntax_token_delim_t;

@JamesWrigley JamesWrigley self-assigned this Jun 28, 2024
@Gnimuc
Copy link
Member

Gnimuc commented Jun 29, 2024

LGTM.

@Gnimuc Gnimuc merged commit 40f4244 into master Jun 29, 2024
22 checks passed
@Gnimuc Gnimuc deleted the sanity-check-macrofunctionlike branch June 29, 2024 01:50
@Gnimuc
Copy link
Member

Gnimuc commented Jun 29, 2024

cc @MichaelHatherly

@MichaelHatherly
Copy link

Thanks @JamesWrigley.

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.

sanity check failed thrown when generating bindings for lexbor
3 participants