On 2021-01-05, Martin Gregorie wrote:
> On Tue, 05 Jan 2021 14:06:57 -0700, Peter Flass wrote:
>
>> You shouldn’t need declarations in C unless you’re using one of those
>> new-fangled compilers that requires them. Old code should still be
>> supported, though.
>
> Last time I tried it, (about 2 months ago), the current GNU C compiler
> accepts the old K&R C first edition procedure declaration syntax. I wish
> more compilers worked this way.
I write functions this way:
#ifdef PROTOTYPE
char *foo(char *bar, int baz)
#else
char *foo(bar, baz) char *bar; int baz;
#endif
One #define in a header file adapts it to any old or new compiler.
It works for declarations too.
--
/~\ Charlie Gibbs | "Some of you may die,
\ / | but it's a sacrifice
X I'm really at ac.dekanfrus | I'm willing to make."
/ \ if you read it the right way. | -- Lord Farquaad (Shrek)
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|