[tz] tzcode: uninitialized sp->charcnt gives clang analyzer warning

Jan Engelhardt jengelh at inai.de
Wed Aug 11 08:47:18 UTC 2021


On Wednesday 2021-08-11 01:11, Paul Eggert wrote:
>>> With these patches you should be able to run clang this way:
>>>
>>>   clang --analyze -Xanalyzer -analyzer-output=text localtime.c \
>>>     -DALL_STATE -DHAVE_MALLOC_ERRNO=0
>>>
>>> and get a clean report.
>> 
>> Certainly not.
>
> Did you actually try it? It worked for me. I am using clang 12.0.0 (Fedora
> 12.0.0-2.fc34) on x86-64. The key is that -DHAVE_MALLOC_ERRNO=0 option.

But I have a platform where malloc does set errno on failure, hence I
am looking (only) at the -DHAVE_MALLOC_ERRNO=1 configuration and
what clang outputs there.


More information about the tz mailing list