Skip to content

Conversation

@bnoordhuis
Copy link
Contributor

Fixes: #585


static js_force_inline JSValue JS_NewBool(JSContext *ctx, JS_BOOL val)
{
(void)&ctx;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the & necessary? I thought (void)ctx; would be enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not necessary here but it's a general precaution, in case the unused thing is a macro that evaluates to something non-addressable (because that probably indicates dead code, or a bug.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL!

@bnoordhuis bnoordhuis merged commit d2bca87 into quickjs-ng:master Oct 26, 2024
47 checks passed
@bnoordhuis bnoordhuis deleted the fix585 branch October 26, 2024 15:10
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.

Compilation in C++ fails when -Wpedantic and -Werror=unused-parameter flags are used

2 participants