Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix problems in relation to Fedora's C99 instrumentation (#665)
This commit applies the necessary changes to the ksh codebase to fix C99 compilation when using Red Hat's instrumented GCC[*], though note that a patch to redhat-rpm-config is also required and must be applied separately[*2]. [*1] https://fedoraproject.org/wiki/Toolchain/PortingToModernC [*2] #664 (comment) src/lib/libast/comp/conf.tab: - Add include directives to fix implicit function declarations that cause the PID_MAX test to silently fail. This compile error occurs on all platforms when compiling with strict C99, but wasn't exposed even after setting IFFEFLAGS to -d1 or -d2 (that's likely a separate bug in conf.sh that'll need fixing). As a consequence, it could cause following bug in the getconf builtin (now fixed as of this commit): $ /opt/ast/bin/getconf PID_MAX 30000 # Wrong, should be the platform value (e.g., 4194304) src/lib/libast/{features/lib,sfio/sfhdr.h}: - Delete the lib_poll_fd_2 feature test and associated code, which allowed ksh to used non-compliant implementations of poll(3). This feature test fails on POSIX-compliant systems with int-conversion errors, which is the expected result. However, the C99 instrumentation used by Red Hat marks the entire build as a failure because of the fact those errors exist at all, even though the build proceeds as normal. Fortunately, the operating systems supported by ksh (AFAIK) all have proper, POSIX-compliant versions of poll() and thus don't need this test. To work around the flawed instrumentation, the unnecessary test has been jettisoned.
- Loading branch information