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

(minor) Some functions missing prototypes #74

Closed
fenugrec opened this issue Dec 12, 2021 · 5 comments
Closed

(minor) Some functions missing prototypes #74

fenugrec opened this issue Dec 12, 2021 · 5 comments
Assignees
Labels
resolved-on-develop A changeset fixing this issue has been commiutted to the development branch task

Comments

@fenugrec
Copy link

Compiling with -Werror=missing-prototypes (I have that set globally in a project), causes these:

gpibusb-firmware-arm/printf/src/printf/printf.c:483:8: error: no previous prototype for 'apply_scaling' [-Werror=missing-prototypes]
  483 | double apply_scaling(double num, struct scaling_factor normalization)
      |        ^~~~~~~~~~~~~
gpibusb-firmware-arm/printf/src/printf/printf.c:488:8: error: no previous prototype for 'unapply_scaling' [-Werror=missing-prototypes]
  488 | double unapply_scaling(double normalized, struct scaling_factor normalization)
      |        ^~~~~~~~~~~~~~~
gpibusb-firmware-arm/printf/src/printf/printf.c:493:23: error: no previous prototype for 'update_normalization' [-Werror=missing-prototypes]
  493 | struct scaling_factor update_normalization(struct scaling_factor sf, double extra_multiplicative_factor)
      |                       ^~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Perhaps those functions could be declared as static since (if I understand correctly) they're not meant to be used outside of printf.c ?

eyalroz added a commit that referenced this issue Dec 12, 2021
…otypes are now `static`, and will not raise any eyebrows when the resulting object is inspected.
@eyalroz eyalroz self-assigned this Dec 12, 2021
@eyalroz eyalroz added resolved-on-develop A changeset fixing this issue has been commiutted to the development branch task labels Dec 12, 2021
@eyalroz
Copy link
Owner

eyalroz commented Dec 12, 2021

Sure, why not. Note this won't reach the master branch for a while, as I've just released 5.2.0.

@fenugrec
Copy link
Author

that's fine, I'm pulling in as a git submodule here. Thanks !

eyalroz added a commit that referenced this issue Jan 5, 2022
…otypes are now `static`, and will not raise any eyebrows when the resulting object is inspected.
@phillipjohnston
Copy link

I saw this tagged as fixed-on-develop, but I get this warning in GCC-9 on the develop branch (none on master):

../printf/src/printf/printf.c: At top level:
../printf/src/printf/printf.c:952:16: warning: no previous declaration for 'parse_flags' [-Wmissing-declarations]
  952 | printf_flags_t parse_flags(const char** format)
      |

@eyalroz
Copy link
Owner

eyalroz commented Jan 25, 2022

@phillipjohnston : Regressed by a recent commit...

@eyalroz
Copy link
Owner

eyalroz commented Jan 25, 2022

@phillipjohnston : done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolved-on-develop A changeset fixing this issue has been commiutted to the development branch task
Projects
None yet
Development

No branches or pull requests

3 participants