Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Uppercase BUG_* IDs are shell bug IDs as used by the Modernish shell library.
- Fixed an issue, introduced on 2022-06-13, causing a subshell to fork
unnecessarily if an EXIT pseudosignal trap is set within it.

- The ksh93 codebase now requires a C99 compiler to build.

2026-03-16:

- Fixed a bug in the join(1) built-in command (bound to /opt/ast/bin) that
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/INIT/README-mamake.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ MAM (Make Abstract Machine) is a simple rule-based make language
that is implemented in just ten four-letter commands and four attributes,
yet allows unlimited flexibility as it can execute arbitrary shell code.
The program implementing MAM, `mamake`,
is a portable C90 program written in a single file, `mamake.c`.
is a portable C99 program written in a single file, `mamake.c`.
This allows ksh 93u+m,
or other programs using this build system,
to be built using only a standard C compiler and utilities installation
Expand Down
56 changes: 5 additions & 51 deletions src/cmd/INIT/iffe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ is_hdr() # [ - ] [ file.c ] hdr
esac
is hdr $1
case $1 in
sys/types.h | limits.h | stdio.h | unistd.h)
# These are often tested for repeatedly, especially sys/types.h.
# But POSIX has specified these since issue 1 (1988). It's 2023.
# Skip the compile to save time, but act like a positive test.
sys/types.h | limits.h | stddef.h | stdio.h | stdlib.h | unistd.h)
# These are often tested for repeatedly, but POSIX has specified
# these since issue 1 (1988). It's 2026. Skip the compile to save time,
# but act like a positive test.
: 2>$tmp.e
;;
*) compile $cc -c $_is_hdr_file <&$nullin >&$nullout 2>$tmp.e
Expand Down Expand Up @@ -689,7 +689,7 @@ case $( (getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null ) in
}
[+?\abegin\a\b{\b ... \b}end\b delimit multiline code blocks that override
or augment the default code provided by \biffe\b. User supplied code
blocks should be compatible with the C89/C90 C language
blocks should be compatible with the C99 C language
standard for maximal portability. Test code may call the function
\bNOTE("...")\b to emit short text in \b--verbose\b output; only one
\bNOTE()\b should be called per test for readability. In addition to
Expand Down Expand Up @@ -1162,7 +1162,6 @@ can=
cansep=
cctest=
file=
hdrtest=
ifelse=NONE
ifstack=
ini=
Expand Down Expand Up @@ -2263,51 +2262,6 @@ int x;

cc="$cc $mac"

# check for global default headers (some cc -E insist on compiling)

case $hdrtest in
'') hdrtest=1
allinc=
for x in types
do case $config in
0) c=_sys_${x}
;;
1) case $shell in
ksh) typeset -u u=$x ;;
*) u=$(echo $x | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ) ;;
esac
c=HAVE_SYS_${u}_H
;;
esac
x=sys/$x.h
echo "${allinc}#include <$x>" > $tmp.c
if is_hdr $x
then gothdr="$gothdr + $x"
case $explicit in
0) can="$can$cansep#define $c 1 /* #include <$x> ok */"
nan="$nan$cansep$c=1"
cansep=$nl
;;
esac
eval $c=1
allinc="${allinc}#include <$x>$nl"
else gothdr="$gothdr - $x"
case $explicit$all$config$undef in
0?1?|0??1)
can="$can$cansep#undef $c /* #include <$x> not ok */"
nan="$nan$cansep$c="
cansep=$nl
;;
01??) can="$can$cansep#define $c 0 /* #include <$x> not ok */"
nan="$nan$cansep$c=0"
cansep=$nl
;;
esac
fi
done
;;
esac

# add implicit headers/libraries before the checks

case $op in
Expand Down
Loading