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.84%. Comparing base (a777c7b) to head (57c6f8f).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #9081   +/-   ##
========================================
  Coverage    80.83%   80.84%           
========================================
  Files         1715     1715           
  Lines       189989   189990    +1     
  Branches        73       73           
========================================
+ Hits        153576   153594   +18     
+ Misses       36413    36396   -17     

☔ 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 2 times, most recently from ac970a3 to 2163182 Compare July 27, 2026 14:33
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 2163182 to 57c6f8f Compare July 31, 2026 08: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