Skip to content

fix: silence unused parameter warnings in scanner.c#380

Open
0x1050 wants to merge 1 commit intotree-sitter:masterfrom
0x1050:fix-unused-parameter-warnings
Open

fix: silence unused parameter warnings in scanner.c#380
0x1050 wants to merge 1 commit intotree-sitter:masterfrom
0x1050:fix-unused-parameter-warnings

Conversation

@0x1050
Copy link
Copy Markdown

@0x1050 0x1050 commented Apr 8, 2026

Adds (void) casts for unused parameters in external scanner interface functions to silence compiler warnings and improve portability.

The external scanner API requires these function signatures, but not all parameters are used in this implementation. Adding explicit void casts documents this is intentional and prevents warnings on stricter compiler configurations.

Alternative approaches like adding -Wno-unused-parameter to CFLAGS would suppress all unused parameter warnings globally, potentially hiding real bugs elsewhere.

Add (void) casts for unused parameters in external scanner interface
functions to improve compiler portability and silence warnings on
stricter compiler configurations.

Another fix would be to add 'CFLAGS += -Wno-unused-parameter' to
the MakeFile, but that would have just hidden the error even if they
might be a real bug. This only supresses them they need to be.
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.

1 participant