Hello,
I believe there is a fundamental solution and a workaround
for this issue.
1. Fundamental solution
Rewrite the code to operate according to the tag files,
in accordance with the established rule.
2. Workaround
Use project-based gtags.conf. You can reference a shared
gtags.conf within the project.
$ cp /usr/local/share/gtags/gtags.conf .
$ vi gtags.conf
+-----------------------------
|default:\
| :tc=native:
+-----------------------------
|
v
+-----------------------------
|default:\
| :tc=universal-ctags:
+-----------------------------
$ gtags
$ global -f global-f_bug.c
$ global -f global-f_bug.c -r
---
I originally chose the current parser-based implementation
because I believed it was efficient. However, the time may
have come to reconsider that.
What do you think?
On Sat, Sep 5, 2026 at 8:55 AM Jason Hood <[email protected]> wrote:
>
> On 5/09/2026 4:36, [email protected] wrote:
> > global -f fails to report functions using [[gnu::nonnull(...)]]
>
> This case doesn't actually use the db, so it's using the built-in parser.
>
> G:\>global -f global-f_bug.c -v
> memcpy_good 11 global-f_bug.c void *memcpy_good(void *restrict dest,
> const void *restrict src, size_t
> 1 object located (no index used).
>
> G:\>del GTAGS
>
> G:\>global -f global-f_bug.c -v
> global: GTAGS not found.
>
> G:\>touch GTAGS
>
> G:\>global -f global-f_bug.c -v
> memcpy_good 11 global-f_bug.c void *memcpy_good(void *restrict dest,
> const void *restrict src, size_t
> 1 object located (no index used).
>
> G:\>global --gtagslabel=universal-ctags
> --gtagsconf=/usr/share/gtags/gtags.conf -f global-f_bug.c
> memcpy_bad 2 global-f_bug.c void *memcpy_bad(void *restrict dest,
> const void *restrict src, size_t
> memcpy_good 11 global-f_bug.c void *memcpy_good(void *restrict dest,
> const void *restrict src, size_t
>
> --
> Jason.
>
--
Shigio YAMAGUCHI <[email protected]>
PGP fingerprint:
26F6 31B4 3D62 4A92 7E6F 1C33 969C 3BE3 89DD A6EB