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

Re: smatch overzealous ?

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


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:


With Clang, #undef'ing strcmp will remove the warning.

	Jonathan Neuschäfer
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