Closed db48x closed 5 days ago
I see that parser.rs:288 has c.get_name().unwrap_or_default()
, so I guess that’s where the empty string is coming from. get_name()
is a simple wrapper around clang_getCursorSpelling
from libclang, so I guess we just get what we get.
I can't reproduce, this works fine in the example directory. Can you share your config file? This may be because you forgot to pass -x c++ to clang.
[input]
glob = "src/*.h"
compiler_arguments = ["-Isrc -isystem src/third-party -DGIT_VERSION -DTILES -DBACKTRACE -DLOCALIZE -Og -Werror -Wall -Wextra -Wformat-signedness -Wlogical-op -Wmissing-declarations -Wmissing-noreturn -Wnon-virtual-dtor -Wold-style-cast -Woverloaded-virtual -Wpedantic -Wsuggest-override -Wunused-macros -Wzero-as-null-pointer-constant -Wno-unknown-warning-option -Wno-dangling-reference -Wno-c++20-compat -Wredundant-decls -ggdb -g -fsigned-char -std=c++17 -I/usr/include/SDL2 -D_REENTRANT -I/usr/include/SDL2 -D_REENTRANT -DHWY_SHARED_DEFINE -DAVIF_DLL -I/usr/include/webp -I/usr/include/libpng16 -DWITH_GZFILEOP -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-6 -pthread -I/usr/include/freetype2 -I/usr/include/libpng16 -DWITH_GZFILEOP -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-6 -pthread -I/usr/include/SDL2 -D_REENTRANT -DSDL_SOUND -MMD -MP"]
Adding -x c++
to compiler_arguments
doesn’t change the result.
Try splitting your arguments, compiler_arguments
is an array of arguments. So it should be ["-Isrc", "-isystem", ...]
I can do that, but is it really relevant? It just concatenates them back into a single string.
I can do that, but is it really relevant? It just concatenates them back into a single string.
Yes. It seems like libclang expects an array.
Yea, that does fix it. And I was misremembering; it’s compiler_invocation
in the [doctests]
section that is joined back into a single string.
Maybe it should print a warning if compiler_arguments
looks suspiciously like a single string with spaces in it?
Yea, that does fix it. And I was misremembering; it’s
compiler_invocation
in the[doctests]
section that is joined back into a single string.Maybe it should print a warning if
compiler_arguments
looks suspiciously like a single string with spaces in it?
Yeah that is a good idea, I suppose I could also add some kind of fallback, like if there's only one element in the array and it is space-separated, split it into a proper array
Hello, we tried to solve the issue.
This is what we did:
Modified the Field struct to include a default_value field and updated the parse_record function to correctly parse default-initialized member variables. This change will allow cppdoc to properly display structs with default-initialized members.
You can review changes in this commit: https://github.com/mnmnk43434/rdmsr-cppdoc-7/commit/b525c929c11acb30edc0e6e8cda57221ec9f605e.
[!CAUTION] Disclaimer: The concept of solution was created by AI and you should never copy paste this code before you check the correctness of generated code. Solution might not be complete, you should use this code as an inspiration only.
If you no longer want Latta AI to attempt solving issues on your repository, you can block this account.
Given the struct
mvwzstr
:cppdoc outputs:
The types are not perfect either, but let’s start with the name.