Skip to content

Fightwarn - static funcs and vars#903

Merged
jimklimov merged 104 commits intonetworkupstools:masterfrom
jimklimov:fightwarn-static-funcs-vars
Nov 26, 2020
Merged

Fightwarn - static funcs and vars#903
jimklimov merged 104 commits intonetworkupstools:masterfrom
jimklimov:fightwarn-static-funcs-vars

Conversation

@jimklimov
Copy link
Copy Markdown
Member

@jimklimov jimklimov commented Nov 25, 2020

This PR eradicates all seen warnings about non-static variables and functions not pre-defined (e.g. exposed in headers as extern vars or known methods).

For a majority of cases the right way was indeed to declare them static in the file, some were also not used and so commented away.

In a few cases the shared variables and methods were in fact used, so marking them static broke test builds overall - so for those code was shuffled to expose them properly.

Another frequent "offense" was "invalid prototypes" where declarations of routines without parameters must convey ...(void) explicitly. Implementations can stay with ...() it seems.

Compiler is now satisfied, practical tests whether stuff works not performed however.

This PR plucks a couple of commits from other still open PRs in the fanout after #823 / #844 effort, to avoid merge conflicts later on.

@jimklimov jimklimov requested review from clepple and zykh November 25, 2020 02:20
@lgtm-com
Copy link
Copy Markdown

lgtm-com Bot commented Nov 25, 2020

This pull request introduces 2 alerts and fixes 7 when merging bed618177d546766753683b90f9ecafa8025abc3 into 58fff85 - view on LGTM.com

new alerts:

  • 2 for FIXME comment

fixed alerts:

  • 5 for Short global name
  • 2 for Local variable hides global variable

…dow global varnames "upsfd" (from scan_eaton_serial.c and main.c) with func argument "upsfd"
…ng[] file-local variable as static, and fix its indentation
@jimklimov jimklimov force-pushed the fightwarn-static-funcs-vars branch from bed6181 to 28e892f Compare November 25, 2020 10:17
@lgtm-com
Copy link
Copy Markdown

lgtm-com Bot commented Nov 25, 2020

This pull request introduces 2 alerts and fixes 7 when merging 28e892f into 4f328b3 - view on LGTM.com

new alerts:

  • 2 for FIXME comment

fixed alerts:

  • 5 for Short global name
  • 2 for Local variable hides global variable

@jimklimov jimklimov merged commit 1d9d22a into networkupstools:master Nov 26, 2020
@jimklimov jimklimov deleted the fightwarn-static-funcs-vars branch November 26, 2020 09:44
@jimklimov jimklimov restored the fightwarn-static-funcs-vars branch December 29, 2020 13:58
@jimklimov jimklimov deleted the fightwarn-static-funcs-vars branch November 10, 2021 12:53
@jimklimov jimklimov restored the fightwarn-static-funcs-vars branch December 3, 2021 14:21
@jimklimov jimklimov deleted the fightwarn-static-funcs-vars branch December 3, 2021 14:37
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.

1 participant