Powered by Linux
Re: smatch overzealous ? — Semantic Matching Tool

Re: smatch overzealous ?

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

 



i did not try it
but if the built-in is a problem maybe it is more easy to
disable it with -fno-builtin

re,
 wh

Am 29.09.2014 19:26, schrieb Dan Carpenter:
> On Mon, Sep 29, 2014 at 07:11:57PM +0200, Jonathan Neuschäfer wrote:
>> On Thu, May 29, 2014 at 05:56:08PM +0200, walter harms wrote:
>>> Hi list,
>>> i was trying smatch at libX11.
>>>
>>> It was complaining about a construction what i found valid.
>>> The smatch version is recent (unfortunately the programm does not support
>>> --version).
>>>
>>> ~/src/libX11-1.6.2/src/xkb/XKBUse.c:657 XkbUseExtension() error: buffer overflow '("0")' 2 <= 2
>>>
>>> the code in question (complain is about strcmp() ).
>>>       if ((str = getenv("_XKB_LATIN1_LOOKUP")) != NULL) {
>>>          if ((strcmp(str, "off") == 0) || (strcmp(str, "0") == 0))
>>>
>>>
>>> bug or do i miss something ?
>>
>> I've seen the same warning with Clang. I figured out that it is probably
>> caused by glibc inlining calls to strcmp with short constant strings:
>>
>> 	http://sources.debian.net/src/glibc/2.19-9/sysdeps/x86/bits/string.h/?hl=1108#L1106
>>
>> With Clang, #undef'ing strcmp will remove the warning.
>>
> 
> I should just special case this...  There used to be code to silence
> these warnings but it bit rotted.
> 
> regards,
> dan carpenter
> 
--
To unsubscribe from this list: send the line "unsubscribe smatch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux