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

Make quickjs.h -Wall -Wextra -pedantic clean #628

Merged
merged 1 commit into from
Oct 26, 2024

Conversation

bnoordhuis
Copy link
Contributor

Fixes: #585

@@ -514,21 +514,25 @@ JS_EXTERN int JS_IsRegisteredClass(JSRuntime *rt, JSClassID class_id);

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