This supports C11 syntax and a handful of GNU C extensions. If your software
-std=gnu*, it will likely not be parsed successfully. You will
undoubtably run into some GNU extensions anyway, please report them
annotatec [-gdD] [-C <cpp...>] files... >annotations.json
This will print annotations to stdout and progress to stderr. For information about uploading these annotations to git.sr.ht, see the git.sr.ht docs.
-C flag allows you to specify a custom C preprocessor command to
use, where you will need to supply it with a list of include directories,
macros, and so on, which matches those used in your source tree, as well as the
C standard to target. For example:
annotatec -C "cpp -std=c11 -Iinclude $(pkg-config --cflags libgit2)"
You also will almost certainly want to specify the
-g flag, which will
translate file paths into git blob IDs.
To generate annotations for all C files in your git repo suitable for sending to git.sr.ht:
find . -name "*.c" | xargs \ annotatec -gC "cpp -std=c11 -Iinclude $(pkg-config --cflags libgit2)" \ > annotations.json
Submit bugs to ~sircmpwn/annotate.
Send support requests to sr.ht-discuss.