runit icon indicating copy to clipboard operation
runit copied to clipboard

Fix clang warnings

Open 0x5c opened this issue 1 year ago • 1 comments

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

  • [X] 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.
    • glorious -Wempty-body in buffer_put.c https://github.com/void-linux/runit/blob/2b8000f1ebd07fd68ee0e3c32737d97bcd1687fb/src/buffer_put.c#L18 It's interesting to see how much has that line spread in the wild.
    • gnarly -Wdeprecated-non-prototype in buffer_{get,put}.c https://github.com/void-linux/runit/blob/2b8000f1ebd07fd68ee0e3c32737d97bcd1687fb/src/buffer_put.c#L13

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

0x5c avatar May 02 '23 01:05 0x5c

@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.

rilysh avatar Jun 07 '23 04:06 rilysh