Skip to content

parser.c:254:17: warning: null character(s) preserved in literal #185

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

Open
SkybuckFlying opened this issue Apr 28, 2025 · 0 comments
Open

Comments

@SkybuckFlying
Copy link

skybuck@SuperPC2023:/mnt/g/tools/plandex/linux amd64 binary/server/version 2.0.6/app/server$ go run main.go

github.com/smacker/go-tree-sitter/lua

parser.c:254:17: warning: null character(s) preserved in literal
254 | [anon_sym_] = " ",
| ^

static const char * const ts_symbol_names[] = {
[ts_builtin_sym_end] = "end",
[anon_sym_] = "
^

Seems like an accident or maybe intentional null character was added to this array ?

I am not sure if this array is trying to encode a null terminator character or if it's something strange an error...

???

I get this warning when trying to run plandex on windows 11/wsl/linux ubuntu 24.04.2.

Program seems to work, just slightly annoying it displays this somewhat strange warning...

AI suggestion to surpress warnings:
go run main.go 2>/dev/null

This hides warning messages, but keeps errors visible.

However I would worry that maybe other warnings are surpressed, so for now, I will just let it be until further info from developers is shared if this is normal and to be expected or if something strange is going on with this null terminator ?

Maybe an escape code should be used to make it compile nicer ?

AI code fix suggestions:

Possible Fix: Use an Explicit Escape Code
You could try modifying the affected line to ensure proper encoding:
[anon_sym_] = " \x20", // Using hex for space instead of possible null character


✅ "\x20" explicitly defines a space character, avoiding any invisible null issues.
Alternative: Ensure Correct String Termination
If the array needs proper termination, adding explicit \0 might help:
[anon_sym_] = " \0",

✅ This makes sure the null character is intentional and properly handled.

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

No branches or pull requests

1 participant