Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix all aCalloc calls that had their parameters in the wrong order #3280

Merged
merged 2 commits into from
Feb 29, 2024

Conversation

guilherme-gm
Copy link
Member

@guilherme-gm guilherme-gm commented Feb 10, 2024

Pull Request Prelude

Changes Proposed

Since gcc-14 began running in our CI, we had been having random failures in aCalloc due to wrong order of parameters. For some reason, fixing one place doesn't necessarily triggers the error to the other one...

In this PR I looked through every place we use aCalloc and fixed the order to match the function expectations: (number of elements, size of each element). While using in the reverse order works for the language, it fails in gcc-14 validation.

I also renamed the macro parameters to be num / size instead of m/n (which always makes me ask what each one is supposed to receive).

Issues addressed:
None, I think

gcc-14 validates the order of parameters in calloc, so giving proper
names for each of them makes easier to tell what should go in each one.

it should always be (number of element, size of each element) or gcc 14
will give warnings.

other macros were adjusted where size/number also applied to keep the
name standard
aCalloc should be called with (number of elements, size of each element)
or gcc 14 will warn.
@Asheraf Asheraf added this to the Release v2024.02 milestone Feb 28, 2024
@MishimaHaruna MishimaHaruna merged commit 291bb71 into HerculesWS:master Feb 29, 2024
256 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.

4 participants