Source-Changes-D archive

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

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




> On May 3, 2024, at 11:11 AM, Roland Illig <roland.illig%gmx.de@localhost> wrote:
> 
> 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.

Got it, thank you!

christos


Home | Main Index | Thread Index | Old Index