Allocator sizeof operand mismatch

Erik Cederstrand erik at cederstrand.dk
Wed Sep 26 12:49:43 UTC 2012


Clang Analyzer reports about 100 cases of "Allocator sizeof operand mismatch", for example:

http://scan.freebsd.your.org/freebsd-head/sbin.umount/2012-09-23-amd64/report-k4ThD9.html#EndPath

The reports seem to be valid, but I'm no export. I can work out that the above should probably be fixed by changing "sizeof(int)" to "sizeof(char)" and that it incidentally works anyway since both types have the same size in most cases. But I probably won't detect if the error is somewhere else than the arguments to malloc/calloc.

Is someone willing to help me fix these, or should I start filing PR's with patches?

Thanks,
Erik


More information about the freebsd-hackers mailing list