Skip to content

Conversation

@atalkingegg
Copy link
Contributor

Fixes compiler warning with GCC 14.x or newer.

gcc -DCALC_SRC -DCUSTOM -Wall -Wextra -pedantic -UUNBAN -fPIC -O3 -g3 -c -o const.o const.c
const.c: In function 'initconstants':
const.c:48:48: warning: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
48 | consttable = (NUMBER **) calloc(sizeof(NUMBER *), CONSTALLOCSIZE);
| ^~~~~~
const.c:48:48: note: earlier argument should specify number of elements, later size of each element

Also fixes potential memory alignment issues.

Copy link
Owner

@lcn2 lcn2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @atalkingegg

@lcn2 lcn2 merged commit 2bcc892 into lcn2:master Dec 3, 2025
3 checks passed
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