Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Clang vs. lint's strict bool mode (was: Re: CVS commit: src/usr.bin/base64)



Am 02.05.2024 um 22:44 schrieb Christos Zoulas:
> On 2024-05-02 3:04 pm, Christos Zoulas wrote:
>> This is with clang.
>>
> And I don't get it. Gcc produces:
>
>    if (ignore &&
> # 139 "base64.c" 3 4
>                 ((int)((_ctype_tab_ + 1)[(
> # 139 "base64.c"
>                 c
> # 139 "base64.c" 3 4
>                 )] & 0x0040))
> # 139 "base64.c"
>                           )
>     continue;

Since the '&&' in the condition comes from a system header, lint is not
as strict as it could be, to allow user code to pass strict bool mode
even when the system headers don't comply.

> Clang produces:
>    if (ignore && ((int)((_ctype_tab_ + 1)[(c)] & 0x0040)))
>     continue;

Clang doesn't distinguish the system parts from the non-system parts,
and that's the crucial difference. I never tested the combination of
Clang with lint. I will do so now.

Roland



Home | Main Index | Thread Index | Old Index