Open 0x5c opened 1 year ago
@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.
When building with clang, we get a different set of warnings than with gcc. This is my attempt at fixing them.
-Wdeprecated-non-prototype
, exposing previously hidden warnings:-Wincompatible-pointer-types-discards-qualifiers
for byte.h-Wincompatible-pointer-types
for alloc.h-Wempty-body
inbuffer_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.-Wdeprecated-non-prototype
inbuffer_{get,put}.c
https://github.com/void-linux/runit/blob/2b8000f1ebd07fd68ee0e3c32737d97bcd1687fb/src/buffer_put.c#L13I also found and removed unused functions that had no implementations.