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.77%. Comparing base (2a9730d) to head (34df576).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #9081      +/-   ##
===========================================
- Coverage    80.77%   80.77%   -0.01%     
===========================================
  Files         1712     1712              
  Lines       189814   189815       +1     
  Branches        73       73              
===========================================
  Hits        153328   153328              
- Misses       36486    36487       +1     

☔ 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
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 9f4a421 to 34df576 Compare July 9, 2026 10:12
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