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

Fix clang warnings #26

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Conversation

0x5c
Copy link

@0x5c 0x5c commented May 2, 2023

When building with clang, we get a different set of warnings than with gcc. This is my attempt at fixing them.

  • Many instances of trivial -Wdeprecated-non-prototype, exposing previously hidden warnings:
    • -Wincompatible-pointer-types-discards-qualifiers for byte.h
    • -Wincompatible-pointer-types for alloc.h
  • buffer.h - Since I'm currently in an attempt to remove buffer.h, I'm not taking care of it here.

I also found and removed unused functions that had no implementations.

0x5c added 3 commits May 1, 2023 21:20
- Functions were used without prototypes (clang's -Wdeprecated-non-prototype).

- Both wait_stop() and wait_stopnohang() had no definition anywhere, nor were
  used anywhere.
- Functions were used without prototypes (clang's -Wdeprecated-non-prototype).
  This exposes new -Wincompatible-pointer-types-discards-qualifiers warnings.

- byte_zero() was not defined anywhere nor used anywhere.
Functions were used without prototypes (clang's -Wdeprecated-non-prototype).
This exposes new -Wincompatible-pointer-types warnings.
@rilysh
Copy link

rilysh commented Jun 7, 2023

@0x5c runit has mix of K&R C (C78) and some ANSI C. I saw in several places, you've used ANSI C like function declaration. Note that this was intentional to use older version of C to make runit compatible as much UNIX-based platforms as it could and generally compiler warnings doesn't necessarily means anything wrong. Compilers are just ahead of time and very old compilers may fail to compile, if they don't satisfy with the standard.

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.

2 participants