Skip to content

Commit

Permalink
Fix remaining calloc param reversals
Browse files Browse the repository at this point in the history
gcc 14 identifies likely places where the sizeof() call is used
for the first parameter to calloc(). This PR fixes the remaining
places in the library where this occurs and reworks a few other
allocations to be more uniform.
  • Loading branch information
Dana Robinson committed Oct 27, 2024
1 parent b8a06b5 commit 0a69091
Show file tree
Hide file tree
Showing 15 changed files with 123 additions and 6,192 deletions.
2 changes: 1 addition & 1 deletion hl/src/H5TB.c
Original file line number Diff line number Diff line change
Expand Up @@ -3185,7 +3185,7 @@ H5TB_create_type(hid_t loc_id, const char *dset_name, size_t type_size, const si
if (H5TBget_table_info(loc_id, dset_name, &nfields, NULL) < 0)
goto out;

if (NULL == (fnames = (char **)calloc(sizeof(char *), (size_t)nfields)))
if (NULL == (fnames = (char **)calloc((size_t)nfields, sizeof(char *))))
goto out;

for (i = 0; i < nfields; i++)
Expand Down
255 changes: 0 additions & 255 deletions src/H5Edefin.h

This file was deleted.

814 changes: 0 additions & 814 deletions src/H5Einit.h

This file was deleted.

442 changes: 0 additions & 442 deletions src/H5Epubgen.h

This file was deleted.

259 changes: 0 additions & 259 deletions src/H5Eterm.h

This file was deleted.

Loading

0 comments on commit 0a69091

Please sign in to comment.