[schilytools] RFC: removal of K&R-style declarations
Robert Clausecker
fuz at fuz.su
Tue Apr 9 18:05:47 CEST 2024
Greetings,
Large parts of the schilytools code base have carefully been designed to
support compilation with pre-ANSI C compilers. This means that function
declarations employ the __PR macro to only generate prototypes if
supported, while function definitions are in K&R style unless the code is
only for platforms that support ANSI C or if it's a varargs function.
This is slowly becoming a liability. K&R-style definitions have been
phased out of the C standard for a while and are not supported anymore.
Compilers like clang have started to warn about them and may no longer
support them in the future. Some platforms (like aarch64 macOS) have
different, less efficient calling conventions for K&R-style functions
and may miscompile code that mixes and matches prototypes with K&R-style
definitions. It is also well known that use of K&R-style definitions
can hide bugs and protability issues that we should want out for.
At the same time, few if any platforms with pre-ANSI compilers remain.
And those that do remain are likely not to be targets to compile
schilytools for.
It is for these reasons that I propose we update schilytools to convert
all K&R-style function definitions to prototype-based definitions in an
upcoming version of schilytools. The target C standard for the
foreseeable future will then be ISO/IEC 9899:1990, also known as ANSI C
or C89. Configure tests and code that aim to work around compatibility
issues with pre-ANSI C compilers will be removed or kept in place as per
the maintainer's discretion.
This email is a request for comments on this proposal. I am in
particular interested in answers to the following questions:
1. Does anybody here use schilytools on a platform whose toolchain does
not support ANSI C? If yes, could you give a brief report of your
use case and expectations? Would you be sad if support for your
platform was dropped?
2. Has anybody attempted to compile schilytools on or for such a
platform since our 2022-09-18 release? Was the attempt successful?
If not, why haven't you reported the failure on our bug tracker?
3. Is anybody here interested in performing regular quality assurance
(e.g. running the test suite, reporting bugs, perhaps assisting in
solving problems) for a pre-K&R platform?
Thank you for your interest in the project.
The schilytools maintainer
Robert Clausecker <fuz at fuz.su>
--
() ascii ribbon campaign - for an encoding-agnostic world
/\ - against html email - against proprietary attachments
More information about the schilytools
mailing list