Skip to content

Commit

Permalink
shmoverride: fix parameters order
Browse files Browse the repository at this point in the history
GCC 14 complains:

    shmoverride.c: In function ...mmap_mfns...:
    shmoverride.c:96:30: error: ...calloc... sizes specified with ...sizeof... in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
       96 |     pfntable = calloc(sizeof(xen_pfn_t), shm_args_mfns->count);
          |                              ^~~~~~~~~
    shmoverride.c:96:30: note: earlier argument should specify number of elements, later size of each element
    cc1: all warnings being treated as errors

QubesOS/qubes-issues#8915
  • Loading branch information
marmarek committed Feb 5, 2024
1 parent 9795a4e commit b99da5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion shmoverride/shmoverride.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static uint8_t *mmap_mfns(struct shm_args_hdr *shm_args) {
struct shm_args_mfns *shm_args_mfns = (struct shm_args_mfns *) (
((uint8_t *) shm_args) + sizeof(struct shm_args_hdr));

pfntable = calloc(sizeof(xen_pfn_t), shm_args_mfns->count);
pfntable = calloc(shm_args_mfns->count, sizeof(xen_pfn_t));
if (!pfntable)
return NULL;
for (i = 0; i < shm_args_mfns->count; i++)
Expand Down

0 comments on commit b99da5a

Please sign in to comment.