Re: including sparse headers in C++ code

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

 



On Son, 2010-10-10 at 13:52 +0200, Kamil Dudka wrote: 
> On Sunday 10 October 2010 13:41:59 Bernd Petrovitsch wrote:
> > On Sam, 2010-10-09 at 14:46 -0700, Christopher Li wrote:
[...] 
> > > Well said. I don't expect sparse to compile in the C++ mode. Making
> > > sparse header usable in C++ seems reasonable to me.
> >
> > Well, sparse uses C99.
> > If one #include's <stdbool.h> at some day (as I did;-), than "true" and
> > "false" don't work any longer that good as variable names.
> 
> The clash of sparse headers with <stdbool.h> should be already fixed:
> 
> http://git.kernel.org/?p=devel/sparse/sparse.git;a=commitdiff;h=0be55c9

So far so good IMHO. But: 
----  snip  ----
{102}egrep -wc 'false|true' *.[ch] | grep -v :0
compile-i386.c:19
evaluate.c:13
expand.c:10
flow.c:10
inline.c:13
linearize.c:6
pre-process.c:3
show-parse.c:3
simplify.c:9
symbol.c:1
tokenize.c:1
----  snip  ----
There are perhaps false positives in there - but not all.

Perhaps 'sparse' should warn if one names variables, functions, and
similar "true", "false" or with any other C99 keyword.
For C++ keywords, a different option is probably best.

Bernd
-- 
mobile: +43 664 4416156              http://www.sysprog.at/
    Linux Software Development, Consulting and Services

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux