To enable debugging with the option: CFLAGS='-DDEBUG_C' ./autogen.sh I needed to modify this file. It now compiles again, but segfaults, any suggestions are welcome. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/1923
-- Commit Summary --
* Update c.c
-- File Changes --
M ctags/parsers/c.c (2)
-- Patch Links --
https://github.com/geany/geany/pull/1923.patch https://github.com/geany/geany/pull/1923.diff
`scopeKind` is not a string.
Why do you think you need to make this change? It doesn't make sense. What has it got to do with `-DDEBUG`?
What has it got to do with -DDEBUG?
The code in question is guarded with a `DEBUG_C` preprocessor macro, but judging by the comment I doubt anyone since the original TM author has ever used it.
The original code should compile fine, all arguments to the `printf` are `char*` matching the `%s`. So why does it need to be changed? @peter-scholtens please describe the actual original problem, not the problem caused by your erroneous "fix".
@codebrainz is probably right it hasn't been used since Tyrannosaurs programmed in assembler. So describing the original problem would allow people to assist with the actual problem.
@elextr well he did mention it didn't compile with that `DEBUG_C` defined, but it would be helpful to give the resulting compile error so everyone doesn't have to re-compile themselves to see it.
``` parsers/c.c: In function ‘printTagEntry’: parsers/c.c:555:7: error: ‘tagEntryInfo {aka const struct sTagEntryInfo}’ has no member named ‘kindName’; did you mean ‘name’? tag->kindName, tag->extensionFields.implementation, tag->extensionFields.scope[1], ^~~~~~~~ name parsers/c.c:555:75: error: ‘const struct <anonymous>’ has no member named ‘scope’; did you mean ‘scopeKind’? tag->kindName, tag->extensionFields.implementation, tag->extensionFields.scope[1], ^~~~~ scopeKind ```
@codebrainz thanks
but it would be helpful to give the resulting compile error so everyone doesn't have to re-compile themselves to see it.
Yep, my point exactly :)
As @codebrainz said above, it looks like the definition of the structures has changed over time but the debug prints have not been updated. Unfortunately it looks like the suggestions are based purely on similarity of names, not on types, so they are wrong.
My original plan was to solve https://github.com/geany/geany/issues/728, and to study the root cause of that, so I thought it maybe handy to use this debug option. But if it is out-of-date then it is not quite useful. Then please ignore/remove the pull request and give me a hint how to solve it.
Then please ignore/remove the pull request and
You can always close your own pull requests and issues.
give me a hint how to solve it.
On #728 would be the best place.
Closed #1923.
github-comments@lists.geany.org