Skip to content

size_t/ptrdiff_t transition part 5: the libast zakkaya#954

Merged
McDutchie merged 4 commits intoksh93:devfrom
JohnoKing:thickfold-part-5-submission
Mar 28, 2026
Merged

size_t/ptrdiff_t transition part 5: the libast zakkaya#954
McDutchie merged 4 commits intoksh93:devfrom
JohnoKing:thickfold-part-5-submission

Conversation

@JohnoKing
Copy link
Copy Markdown

This is the fifth of the thickfold patch series, which enables ksh93 to operate within a 64-bit address space.

The parts of ksh93 affected by this commit are:

  • The libast compatibility functions.
  • The libast miscellaneous functions (i.e. optget() and friends).
  • The libast portability functions.
  • CDT again (just for a few static function fixes).
  • struniq() (now takes a ptrdiff_t and returns a ptrdiff_t; for AST glob().

Remarks:

  • The second argument of getfsstat() can either be a long (FreeBSD) or a size_t (OpenBSD). This patch opts to cast the second argument as a size_t, which will produce a warning on FreeBSD and no warning on OpenBSD.
  • Fixed a misplaced noreturn attribute for _ast_assertfail and added noreturn to debug_fatal() (which ends with abort()).
  • Marked error_break(), typefix(), and various CDT functions as static to reflect actual usage.

Change in the number of warnings on Linux when compiling with clang using -Wsign-compare -Wshorten-64-to-32 -Wsign-conversion -Wimplicit-int-conversion: 2,450 => 1,946 => 37 (progression from part 4 => part 5 => part 13)

Progresses #592

JohnoKing and others added 4 commits March 27, 2026 18:48
This is the fifth of the thickfold patch series, which enables ksh93
to operate within a 64-bit address space.

The parts of ksh93 affected by this commit are:
- The libast compatibility functions.
- The libast miscellaneous functions (e.g. optget and friends).
- The libast portability functions.

Remarks:
- The second argument of getfsstat can either be a long (FreeBSD)
  or a size_t (OpenBSD). This patch opts to cast the second argument
  as a size_t, which will produce a warning on FreeBSD and no warning
  on OpenBSD.
- Fixed a misplaced noreturn attribute for _ast_assertfail and
  added noreturn to debug_fatal() (whichs ends with abort()).
- Marked error_break(), typefix(), and various CDT functions
  as static to reflect actual usage.

Change in the number of warnings on Linux when compiling with clang using
-Wsign-compare -Wshorten-64-to-32 -Wsign-conversion -Wimplicit-int-conversion:
2,450 => 1,946 => 37 (progression from part 4 => part 5 => part 13)

Progresses ksh93#592
@McDutchie McDutchie merged commit 0e51841 into ksh93:dev Mar 28, 2026
@JohnoKing JohnoKing deleted the thickfold-part-5-submission branch March 29, 2026 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants