Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant code #2890

Closed
wants to merge 1 commit into from
Closed

Remove redundant code #2890

wants to merge 1 commit into from

Conversation

rootkea
Copy link
Contributor

@rootkea rootkea commented Sep 5, 2021

Hello!

While chasing down these clang warnings I found that some code is redundant and can be safely removed:

main/parse.c:5007:26: warning: unused function 'FallbackParser' [-Wunused-function]
static parserDefinition *FallbackParser (void)
                         ^
main/parse.c:5040:26: warning: unused function 'CTagsParser' [-Wunused-function]
static parserDefinition *CTagsParser (void)
                         ^
main/parse.c:5355:26: warning: unused function 'CTagsSelfTestParser' [-Wunused-function]
static parserDefinition *CTagsSelfTestParser (void)
                         ^

This is because we explicitly define EXTERNAL_PARSER_LIST in tm_parsers.h at https://github.com/geany/geany/blob/master/src/tagmanager/tm_parsers.h#L16 so guess no need to check for not defined case?

Thanks!

@elextr
Copy link
Member

elextr commented Sep 6, 2021

Thanks but, the code in the ctags directory is imported mostly unchanged from Universal ctags project, so anything changed in that will simply be re-instated when the ctags version is updated.

There is likely to be a lot of unused stuff there and we just let the linker leave out unused functions. For static ones like those hopefully either the compiler or the linker will omit them. If not well they don't add up to much compared to the effort to remove them, the idea is to use ctags as little changed as possible so updates are easy.

@elextr elextr closed this Sep 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants