Skip to content

Comments

fix: correct strtol0x signature#152

Merged
tomghuang merged 1 commit intomasterfrom
fix-strtol0x-param-width-warnings
Jul 17, 2025
Merged

fix: correct strtol0x signature#152
tomghuang merged 1 commit intomasterfrom
fix-strtol0x-param-width-warnings

Conversation

@tomghuang
Copy link
Contributor

Building with older compilers, such as Xcode's gcc 4.2, triggered "different width due to prototype" warnings.

This occurs because character literals (e.g., 'X') are promoted to int when passed as function arguments, but the strtol0X function signature expected a char.

This change corrects the function signature to accept an int, which resolves the compiler warnings and improves portability.

The gcc versions older than 4.3 cannot build the current code base
without warnings, which are treated as errors, hence cannot build
argtable3. Besides, these old versions cannot enforce standard
compliance properly.

In this patch, we enhance the CMakeList.txt script so we
don't treat warnings as errors in very old gcc versions.
@tomghuang tomghuang force-pushed the fix-strtol0x-param-width-warnings branch from 9e73146 to cf5bee8 Compare July 17, 2025 04:53
@tomghuang tomghuang merged commit 4030e78 into master Jul 17, 2025
12 checks passed
@tomghuang tomghuang deleted the fix-strtol0x-param-width-warnings branch July 17, 2025 16:07
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.

1 participant