Skip to content

Set signedness of "char *" casts to avoid cross-platform differences. - #9081

Open
rod-chapman wants to merge 4 commits into
diffblue:developfrom
rod-chapman:set-char-signedness-in-contracts
Open

Set signedness of "char *" casts to avoid cross-platform differences.#9081
rod-chapman wants to merge 4 commits into
diffblue:developfrom
rod-chapman:set-char-signedness-in-contracts

Conversation

@rod-chapman

@rod-chapman rod-chapman commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Fixes #8991

Explicitly cast to "unsigned char *" rather than "char *". This stabilizes the output GOTO and SMT on platforms where the default signedness of plain "char" is implementation-defined.

@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.83%. Comparing base (f71fdad) to head (2163182).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #9081      +/-   ##
===========================================
- Coverage    80.83%   80.83%   -0.01%     
===========================================
  Files         1715     1715              
  Lines       189948   189949       +1     
  Branches        73       73              
===========================================
- Hits        153540   153538       -2     
- Misses       36408    36411       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rod-chapman
rod-chapman force-pushed the set-char-signedness-in-contracts branch 2 times, most recently from 9e6047c to 5ec1c8a Compare July 3, 2026 19:05
@rod-chapman
rod-chapman force-pushed the set-char-signedness-in-contracts branch 2 times, most recently from 34df576 to 2583b4b Compare July 13, 2026 11:05
@rod-chapman
rod-chapman force-pushed the set-char-signedness-in-contracts branch from 2583b4b to ac970a3 Compare July 27, 2026 11:01
Explicitly cast to "unsigned char *" rather than "char *".
This stabilizes the output GOTO and SMT on platforms
where the default signedness of plain "char" is
implementation-defined.

Signed-off-by: Rod Chapman <rodchap@amazon.com>
This generates stable GOTO and (ultimately SMT) for all
platforms where the default (implementation-defined)
signedness of plain "char" is signed.

Signed-off-by: Rod Chapman <rodchap@amazon.com>
Signed-off-by: Rod Chapman <rodchap@amazon.com>
of memcpy(), memset() and memmove() instead
of implementation-defined signedness of plain "char".

This yields stable GOTO and SMT output on platforms
where the default signnedness of "char" differs.

Signed-off-by: Rod Chapman <rodchap@amazon.com>
@rod-chapman
rod-chapman force-pushed the set-char-signedness-in-contracts branch from ac970a3 to 2163182 Compare July 27, 2026 14:33
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.

Cross-platform instability arising from default signedness of char in contracts library

1 participant