Bug 2144903 - ksh: Porting to C99
Summary: ksh: Porting to C99
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: ksh
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Vincent Mihalkovič
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PortingToModernCHelpNeeded
TreeView+ depends on / blocked
 
Reported: 2022-11-22 16:57 UTC by Florian Weimer
Modified: 2023-09-14 11:55 UTC (History)
5 users (show)

Fixed In Version: ksh-1.0.6-3.fc40
Clone Of:
Environment:
Last Closed: 2023-09-14 11:55:35 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Fedora Package Sources ksh pull-request 20 0 None None None 2023-09-13 15:08:26 UTC
Github ksh93 ksh issues 587 0 None closed Building in strict C99 mode 2023-09-14 11:16:01 UTC

Description Florian Weimer 2022-11-22 16:57:40 UTC
I tried to build ksh in strict C99 mode.  The tester looks the following errors:

*** GCC errors begin ***
/builddir/build/BUILD/ksh-1.0.4/src/cmd/INIT/w2.c:23: implicit function declaration: iswspace
./Fea8d1662.c:45: implicit function declaration: wcwidth
./Fea8d1662.c:38: implicit function declaration: wcwidth
./Fea8d1796.c:162: defaulting to int
./Fea8d1796.c:161: defaulting to int
./Fea8d6386.c:52: defaulting to int
./Fea8d7175.c:6: defaulting to int
./Fea8d7175.c:6: defaulting to int
./Fea8d7175.c:7: defaulting to int
./Fea8d7175.c:3: defaulting to int
conf.tmp.c:30: implicit function declaration: printf
conf.tmp.c:19: implicit function declaration: open
conf.tmp.c:22: implicit function declaration: strtol
conf.tmp.c:23: implicit function declaration: strtol
conf.tmp.c:20: implicit function declaration: open
./ea8d12739.c:41: implicit function declaration: __xstat
./ea8d12739.c:62: implicit function declaration: getfsstat
./ea8d18213.c:44: implicit function declaration: utimets
./ea8d19014.c:40: implicit function declaration: _open
./ea8d19014.c:84: implicit function declaration: _pathconf
./ea8d19014.c:76: implicit function declaration: _link
./ea8d19014.c:74: implicit function declaration: _getpagesize
./ea8d19014.c:86: implicit function declaration: _rename
./ea8d19014.c:92: implicit function declaration: _truncate
./ea8d19014.c:90: implicit function declaration: _stat
./ea8d19014.c:94: implicit function declaration: _unlink
./ea8d19014.c:96: implicit function declaration: _utime
./ea8d19014.c:70: implicit function declaration: _chmod
./ea8d19014.c:63: implicit function declaration: _chdir
./ea8d19014.c:44: implicit function declaration: _close
./ea8d19014.c:42: implicit function declaration: _fstat
./ea8d19014.c:68: implicit function declaration: _access
./ea8d19014.c:47: implicit function declaration: _read
./ea8d19014.c:61: implicit function declaration: _mkdir
./ea8d19014.c:47: implicit function declaration: _write
./ea8d19014.c:104: implicit function declaration: system
*** GCC errors end ***

While some of them are harmless (e.g., _open is definitely not expected to be declared), I don't really see a way to match this feature probing to the actual ksh source code location that triggers the compiler errors. So I'm a bit stumped here.

I've also raised this in an upstream ticket. Eventually, this needs to be fixed upstream.

Comment 1 Ben Cotton 2023-02-07 14:59:36 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 38 development cycle.
Changing version to 38.

Comment 2 Vincent Mihalkovič 2023-02-08 10:44:10 UTC
upstream issue: https://github.com/ksh93/ksh/issues/587

Comment 3 Martijn Dekker 2023-06-13 20:20:03 UTC
The 1.0.6 release should resolve this. Please let me know if there are still problems.

Comment 4 Vincent Mihalkovič 2023-06-26 17:12:35 UTC
I built the 1.0.6 release with an instrumented GCC* (https://koji.fedoraproject.org/koji/taskinfo?taskID=102618961), and this is the output (on x86_64):

*** GCC errors begin ***
./F72c01755.c:166: pointer-from-int-conversion in argument
./F72c01755.c:169: pointer-to-int-conversion in argument
./F72c01755.c:169: pointer-from-int-conversion in argument
./F72c01755.c:167: pointer-to-int-conversion in argument
./F72c01755.c:167: pointer-from-int-conversion in argument
./F72c01755.c:166: pointer-to-int-conversion in argument
conf.tmp.c:22: implicit function declaration: strtol
conf.tmp.c:19: implicit function declaration: open
conf.tmp.c:30: implicit function declaration: printf
conf.tmp.c:20: implicit function declaration: open
conf.tmp.c:23: implicit function declaration: strtol
./72c012523.c:41: implicit function declaration: __xstat
./72c017824.c:44: implicit function declaration: utimets
./72c018531.c:77: implicit function declaration: _link
./72c018531.c:75: implicit function declaration: _getpagesize
./72c018531.c:85: implicit function declaration: _pathconf
./72c018531.c:91: implicit function declaration: _stat
./72c018531.c:93: implicit function declaration: _truncate
./72c018531.c:87: implicit function declaration: _rename
./72c018531.c:71: implicit function declaration: _chmod
./72c018531.c:69: implicit function declaration: _access
./72c018531.c:43: implicit function declaration: _fstat
./72c018531.c:62: implicit function declaration: _mkdir
./72c018531.c:95: implicit function declaration: _unlink
./72c018531.c:41: implicit function declaration: _open
./72c018531.c:64: implicit function declaration: _chdir
./72c018531.c:45: implicit function declaration: _close
./72c018531.c:48: implicit function declaration: _write
./72c018531.c:48: implicit function declaration: _read
./72c018531.c:97: implicit function declaration: _utime
*** GCC errors end ***

I posted the results above, and now I have to look into the actual ksh source code location that triggers the compiler errors.

*https://fedoraproject.org/wiki/Toolchain/PortingToModernC

Comment 5 Martijn Dekker 2023-06-27 04:01:19 UTC
Filed as https://github.com/ksh93/ksh/issues/664

Comment 6 Vincent Mihalkovič 2023-06-27 11:24:39 UTC
Thank you for creating a follow-up issue.

Comment 7 Vincent Mihalkovič 2023-08-23 14:04:47 UTC
Upstream PR: https://github.com/ksh93/ksh/pull/665

Comment 8 Lukáš Zaoral 2023-09-13 15:08:27 UTC
Pagure PR: https://src.fedoraproject.org/rpms/ksh/pull-request/20

Comment 9 Fedora Update System 2023-09-14 11:52:20 UTC
FEDORA-2023-a56ff0af45 has been submitted as an update to Fedora 40. https://bodhi.fedoraproject.org/updates/FEDORA-2023-a56ff0af45

Comment 10 Fedora Update System 2023-09-14 11:55:35 UTC
FEDORA-2023-a56ff0af45 has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.