Thanks.

I have met other parser errors.I think it happen because splint doesn't know
GCC  keywords.

1) ../../../../lint/lintinclude/linux/input.h:1263:170
Parser Error.(For help on parse errors,see splint -help parserrors.)
***Cannot continue.
 
The code of line 263 of input.h is"return dev ?
to_input_dev(get_device(&dev->dev)) : NULL;",and “to_input_dev” is defined
as“#define container_of(ptr, type, member) ({                   \
        const typeof( ((type *)0)->member ) *__mptr = (ptr);    \
        (type *)( (char *)__mptr - offsetof(type,member) );})”

It's apparent that splint doesn't know above definition.Why and how to
resovle?

2) mpp.c:100:113
Parser Error.(For help on parse errors,see splint -help parserrors.)
***Cannot continue.

The code is below.

/*******************************************/
For(n=0;n<ARRAY_SIZE(mpps);n++)

/***********************************************/
/kernel/include/linux/kernel.h:

#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) +
__must_be_array(arr))
/**************************************************************/
/kernel/include/linux/compiler-gcc.h:

#define __must_be_array(a) \
  BUILD_BUG_ON_ZERO(__builtin_types_compatible_p(typeof(a), typeof(&a[0])))
/**************************************************************************/
Splint doesn't "__builtin_types_compatible_p" which is maybe a keyword of
GCC.

How to resolve this problem?


Thanks& best regards!


liping 


-----邮件原件-----
发件人: splint-discuss-boun...@cs.virginia.edu
[mailto:splint-discuss-boun...@cs.virginia.edu] 代表 Wenzel, Bodo
发送时间: 2009年8月19日 17:48
收件人: splint-discuss@mail.cs.virginia.edu
主题: Re: [splint-discuss] parser error on ktime_t using splint on

Ludolf,

You are perfectly right about C99.

> Yes it can. What you call 'initializer' may also be called 'constant'.
> And of course, constants may be used as expression.
Cool, that Splint knows this. Even cooler, if other compiler than GCC
knew this.

I remember that I had problems with an assigment of a correctly built
'constant' to a struct variable, thought assigning the contents of one
struct variable to another of the same type worked. The standard (C90)
is not very clear here. However, the compiler (Keil C51) is not that
perfect thing.

Bodo

_______________________________________________
splint-discuss mailing list
splint-discuss@mail.cs.virginia.edu
http://www.cs.virginia.edu/mailman/listinfo/splint-discuss


_______________________________________________
splint-discuss mailing list
splint-discuss@mail.cs.virginia.edu
http://www.cs.virginia.edu/mailman/listinfo/splint-discuss

Reply via email to