Skip to content

Use signed int to handle getopt_long correctly#15

Merged
iraikov merged 1 commit intoiraikov:masterfrom
frthjf:fix/sign-getopt
Aug 15, 2025
Merged

Use signed int to handle getopt_long correctly#15
iraikov merged 1 commit intoiraikov:masterfrom
frthjf:fix/sign-getopt

Conversation

@frthjf
Copy link
Contributor

@frthjf frthjf commented Aug 15, 2025

Unlike on x86, char can be unsigned by default on ARM systems like TACC Vista. So when getopt_long() returns -1 for indicating end of options, the char c = -1 can end up as 255. This fix addresses the problem by changing the dtype to int which is always signed int on all platforms.

Unlike on x86, `char` can be unsigned by default on ARM systems. So when `getopt_long()` returns -1 for indicating end of options, the `char c = -1` can end up as 255. This fix addresses the problem by changing the dtype to int which is always signed int on all platforms.
@iraikov iraikov merged commit 0567779 into iraikov:master Aug 15, 2025
6 checks passed
@frthjf frthjf deleted the fix/sign-getopt branch August 15, 2025 17:55
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