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

Issue #398: Fix gcc 14 build failure for reversed calloc args #399

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
- {name: 'ubuntu-20.04 gcc-11', os: ubuntu-20.04, cc: 'gcc-11', cxx: 'g++-11', tag: '11', toolchain: 'ppa:ubuntu-toolchain-r/test'}
- {name: 'ubuntu-22.04 gcc-12', os: ubuntu-22.04, cc: 'gcc-12', cxx: 'g++-12', tag: '12'}
- {name: 'ubuntu-24.04 gcc-13', os: ubuntu-24.04, cc: 'gcc-13', cxx: 'g++-13', tag: '13'}
- {name: 'ubuntu-24.04 gcc-14', os: ubuntu-24.04, cc: 'gcc-14', cxx: 'g++-14', tag: '14'}

env:
CC: ${{ matrix.config.cc }}
Expand Down
4 changes: 2 additions & 2 deletions tests/libgearman-1.0/internals.cc
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ static test_return_t gearman_packet_give_data_test(void *)
// @note Since this is a give data, ignore any errors that believe there is
// an implicit memory leak.
size_t data_size= test_literal_param_size("Mine!");
char *data= (char *)calloc(sizeof(char), data_size +1);
char *data= (char *)calloc(data_size +1, sizeof(char));
ASSERT_TRUE(data);
memcpy(data, "Mine!", data_size);

Expand All @@ -345,7 +345,7 @@ static test_return_t gearman_packet_take_data_test(void *)
// Since this is a take data, ignore any errors that believe there is an
// implicit memory leak.
size_t data_size= test_literal_param_size("Mine!");
char *data= (char *)calloc(sizeof(char), data_size +1);
char *data= (char *)calloc(data_size +1, sizeof(char));
ASSERT_TRUE(data);
memcpy(data, "Mine!", data_size);

Expand Down
Loading