Skip to content

64-bit transition part 12: ksh93 lexing, parsing and subshells#967

Merged
McDutchie merged 5 commits intoksh93:devfrom
JohnoKing:thickfold-part-12-submission
Apr 14, 2026
Merged

64-bit transition part 12: ksh93 lexing, parsing and subshells#967
McDutchie merged 5 commits intoksh93:devfrom
JohnoKing:thickfold-part-12-submission

Conversation

@JohnoKing
Copy link
Copy Markdown

This is the twelfth 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 lexing and parsing components in lex.c, parse.c, fcin.c and trestore.c.
    • Added an assert() after stkalloc() to fix the following LTO warning:
warning: 'memset' writing 60 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
      1819 |                         memset(ioq,0,sizeof(*ioq));
           |                         ^
    lto1: note: destination object is likely at address zero
  • Minor fixes for the virtual subshell mechanism.
  • The code underlying shcomp, aka sh_tdump().
  • A minor fix to a cast in sh_timeradd().

Change in the number of warnings on Linux when compiling with clang using -Wsign-compare -Wshorten-64-to-32 -Wsign-conversion -Wimplicit-int-conversion: 481 => 352 => 37 (progression from part 11 => part 12 => part 13)

Progresses #592

This is the twelfth 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 lexing and parsing components in lex.c, parse.c, fcin.c
  and trestore.c.
  - Added an assert() after stkalloc() to fix the following
    LTO warning:
    warning: 'memset' writing 60 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
      1819 |                         memset(ioq,0,sizeof(*ioq));
           |                         ^
    lto1: note: destination object is likely at address zero
- Minor fixes for the virtual subshell mechanism.
- The code underlying shcomp(1), aka sh_tdump().
- A minor fix to a cast in sh_timeradd().

Change in the number of warnings on Linux when compiling with clang using
-Wsign-compare -Wshorten-64-to-32 -Wsign-conversion -Wimplicit-int-conversion:
481 => 352 => 37 (progression from part 11 => part 12 => part 13)

Progresses ksh93#592
@McDutchie
Copy link
Copy Markdown

Added an assert() after stkalloc() to fix the following LTO warning:

Sorry but I don't want to add asserts to silence incorrect compiler warnings, in part because asserts should be getting compiled out on release builds, in part because that's not what asserts are for.

I get why you've been adding a lot of typecasts to silence warnings in extra-paranoid warning modes – it helps you isolate the warnings that tell you where variable types need to change to accommodate large objects in 64-bit address spaces. But this particular warning here is simply wrong, and this isn't the right way to silence it.

If it really annoys you, fair enough; you could instead add a #pragma to disable the warning, with a short comment explaining the reason for adding it.

@McDutchie McDutchie merged commit 63366e3 into ksh93:dev Apr 14, 2026
McDutchie pushed a commit that referenced this pull request Apr 14, 2026
This is the twelfth 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 lexing and parsing components in lex.c, parse.c, fcin.c
  and trestore.c.
- Minor fixes for the virtual subshell mechanism.
- The code underlying shcomp(1), aka sh_tdump().
- A minor fix to a cast in sh_timeradd().

Change in the number of warnings on Linux when compiling with clang
using -Wsign-compare -Wshorten-64-to-32 -Wsign-conversion
-Wimplicit-int-conversion: 481 => 352 => 37 (progression from part
11 => part 12 => part 13)

Progresses #592
@JohnoKing JohnoKing deleted the thickfold-part-12-submission branch April 14, 2026 02:52
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