Skip to content

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

@SkybuckFlying

Description

@SkybuckFlying

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions