SanderMertens / bake

Bake, A build system for building, testing and running C & C++ projects
GNU General Public License v3.0
681 stars 53 forks source link

Fix warning about inverted calloc arguments #110

Closed Gaspard-- closed 1 month ago

Gaspard-- commented 2 months ago

When running setup.sh, I got this nice warning;

drivers/test/src/cdiff.c:697:40: warning: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
  697 |         cdiff_elem *el = calloc(sizeof(cdiff_elem), 1);
      |                                        ^~~~~~~~~~
drivers/test/src/cdiff.c:697:40: note: earlier argument should specify number of elements, later size of each element

This one-line PR fixes the argument order.

Gaspard-- commented 2 months ago

Just realised I'm not sure if clang or g++ was used to compile. I don't think it's important anyways.

SanderMertens commented 1 month ago

Thanks for the PR!