[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
recent typo in sig.c breaks Minix compilation
From: |
Martin D Kealey |
Subject: |
recent typo in sig.c breaks Minix compilation |
Date: |
Fri, 18 Oct 2024 11:15:10 +1000 |
It looks like a recent (last year) typo in sig.c breaks Minix compilation:
$ git log a61ffa78ed^!
> commit a61ffa78ede6df4d1127fddd2e8a1a77a7186ea1
> Author: Chet Ramey <chet.ramey@case.edu>
> Date: 2023-01-03 10:23:11 -0500
> second set of ANSI C changes: C89-style function declarations, more
> inline functions, remove register keyword
> $ git diff a61ffa78ed^! sig.c | head -n13
> diff --git a/sig.c b/sig.c
> index 659545b2e..d2a126715 100644
> --- a/sig.c
> +++ b/sig.c
> @@ -24,7 +24,7 @@
>
> #if defined (HAVE_UNISTD_H)
> # ifdef _MINIX
> -# include <sys/types.h>
> +initialize_shell_signals (# include <sys/types.h>
> # endif
> # include <unistd.h>
> #endif
(I noticed this when using GNU "indent" to check indentation.)
Talking of which, I note several places where there's a construct like:
#ifdef FOO
> if (foo && zot)
> #else
> if (zot)
> #endif
Unfortunately this confuses both the indent program and some editors.
To accommodate these itt would be preferable to have:
if (
> #ifdef FOO
> foo &&
> #endif
> zot)
or alternatively:
#ifdef FOO
> # define FOO_CONDITION() foo
> #else
> # define FOO_CONDITION() 1
> #endif
>
> if (FOO_CONDITION() && zot)
Would you accept patches that introduced either of these?
-Martin