alexfh wrote: Hi @vvuksanovic, the new diagnostic produces some arguable warnings for a number of open-source projects. A few examples: - https://android.googlesource.com/kernel/msm/+/refs/heads/android-msm-crosshatch-4.9-android10/tools/perf/builtin-top.c#313 - `malloc(0)` assigned to a `char*` along with a conditional subsequent `realloc`. In this particular case NULL could have been used instead of `malloc(0)`, but `char*` is rather special in the sense that it's unlikely someone mistakenly allocates less than a byte of memory. - https://github.com/storpipfugl/pykdtree/blob/master/pykdtree/_kdtree_core.c#L596 - this code intentionally allocates less memory for leaf nodes of a tree. - https://projects.blender.org/blender/blender/src/branch/main/source/blender/blenkernel/intern/rigidbody.cc#L1606 - this code intentionally reallocates memory for zero elements.
There's more, but I didn't go through all of them. I have found some questionable code (i.e. it could be written more clearly and without triggering this diagnostic), but no real bugs so far. My question is what could be done here to increase the signal-to-noise ratio? Maybe provide some ways to suppress this (without using pragmas)? https://github.com/llvm/llvm-project/pull/150028 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits