From Chih.Hsieh at Sun.COM Tue Aug 8 13:53:57 2006 From: Chih.Hsieh at Sun.COM (Chih-Hung Hsieh) Date: Tue Aug 8 13:54:04 2006 Subject: [splint-discuss] hack to accept two C99 syntax Message-ID: <44D8CFB5.5050003@Sun.COM> Hi, I started to use splint a couple of weeks ago, and found that it does not recognize the following two C99 syntax rules. 1. declaration in a block following other statements 2. declaration in a for-loop init-expr So I hacked the splint src/cgrammar.y file a little to accept these syntax. So far I haven't found any problem, but use it at your own risk. If you find any error or enhancement of this change, please let me know or post it to the group. The attached diff file for src/grammar.y will increase the R/R conflict to 243. Thanks. Chih-Hung Hsieh -------------- next part -------------- *** orig/splint-3.1.1/src/cgrammar.y Thu Mar 6 23:16:12 2003 --- splint-3.1.1/src/cgrammar.y Mon Jul 31 13:59:39 2006 *************** *** 218,224 **** %type endIter %type functionClauses functionClausesPlain ! %type functionClause functionClause functionClausePlain %type globalsClause globalsClausePlain %type modifiesClause modifiesClausePlain nomodsClause --- 218,224 ---- %type endIter %type functionClauses functionClausesPlain ! %type functionClause functionClausePlain %type globalsClause globalsClausePlain %type modifiesClause modifiesClausePlain nomodsClause *************** *** 1726,1739 **** { $$ = exprNode_doWhile ($2, $5); } | forPred iterDefStmt { $$ = exprNode_for ($1, $2); } ; forPred ! : CFOR TLPAREN optExpr TSEMI optExpr TSEMI { context_setProtectVars (); } optExpr { context_sizeofReleaseVars (); } TRPAREN ! { $$ = exprNode_forPred ($3, $5, $8); context_enterForClause ($5); } ; partialIterStmt --- 1726,1745 ---- { $$ = exprNode_doWhile ($2, $5); } | forPred iterDefStmt { $$ = exprNode_for ($1, $2); } + DeleteInnerScope ; forPred ! : CFOR CreateInnerScope TLPAREN instanceDecl optExpr TSEMI { context_setProtectVars (); } optExpr { context_sizeofReleaseVars (); } TRPAREN ! { $$ = exprNode_forPred ($4, $5, $8); context_enterForClause ($5); } + | CFOR CreateInnerScope TLPAREN optExpr TSEMI optExpr TSEMI + { context_setProtectVars (); } optExpr { context_sizeofReleaseVars (); } + TRPAREN + { $$ = exprNode_forPred ($4, $6, $9); + context_enterForClause ($6); } ; partialIterStmt *************** *** 1861,1866 **** --- 1867,1873 ---- | stmtList TRBRACE { $$ = exprNode_updateLocation ($1, lltok_getLoc ($2)); } | stmtList QNOTREACHED TRBRACE { $$ = exprNode_notReached (exprNode_updateLocation ($1, lltok_getLoc ($3))); } + /* | initializerList TRBRACE { $$ = exprNode_updateLocation ($1, lltok_getLoc ($2)); } | initializerList QNOTREACHED TRBRACE { $$ = exprNode_notReached (exprNode_updateLocation ($1, lltok_getLoc ($3))); } *************** *** 1870,1875 **** --- 1877,1883 ---- { $$ = exprNode_notReached (exprNode_updateLocation (exprNode_concat ($1, $2), lltok_getLoc ($3))); } + */ ; compoundStmtAux *************** *** 1909,1915 **** ; stmtList ! : stmt { $$ = $1; } | stmtList stmt { $$ = exprNode_concat ($1, $2); } ; --- 1917,1925 ---- ; stmtList ! : initializer { $$ = $1; } ! | stmt { $$ = $1; } ! | stmtList initializer { $$ = exprNode_concat ($1, $2); } | stmtList stmt { $$ = exprNode_concat ($1, $2); } ; *************** *** 2138,2143 **** --- 2148,2154 ---- { $$ = exprNode_statement (exprNode_doWhile ($2, $5), $7); } | forPred stmt { $$ = exprNode_for ($1, $2); context_exitForClause ($1, $2); } + DeleteInnerScope ; iterationStmtErr *************** *** 2147,2152 **** --- 2158,2164 ---- | doHeader stmtErr WHILE TLPAREN expr TRPAREN { $$ = exprNode_doWhile ($2, $5); } | forPred stmtErr { $$ = exprNode_for ($1, $2); context_exitForClause ($1, $2); } + DeleteInnerScope ; jumpStmt From raymond-xu at 126.com Fri Aug 18 05:32:04 2006 From: raymond-xu at 126.com (raymond) Date: Fri Aug 18 05:33:43 2006 Subject: [splint-discuss] Unrecognized macros like "timerisset" "timercmp" Message-ID: <1155893524.4953.23.camel@localhost> I'm a new guy on splint, does anyone can help me about the error of "unrecognized ids"! following is my simple c file "test2.c" 1. #include 2. #include 3. #include 4. #include 5. 6. 7. typedef struct timeval * p_timer; 8. typedef struct timeval obj_timer; 9. obj_timer now; 10. int 11. _timer_expire(p_timer tp) 12. { 13. if (timerisset(tp) && timercmp((&now), (tp), >)) { 14. timerclear(tp); 15. return 1; 16. } 17. return 0; 18. } I use the splint cmd like this: splint +posixlib -skip-posix-headers test2.c it outputs : Splint 3.1.1 --- 06 Jan 2006 test2.c: (in function _timer_expire) test2.c:13:6: Unrecognized identifier: timerisset Identifier used in code has not been declared. (Use -unrecog to inhibit warning) test2.c:13:24: Unrecognized identifier: timercmp test2.c:13:48: Parse Error. (For help on parse errors, see splint -help parseerrors.) *** Cannot continue. It seems splint can not recognize the macro in like "timerisset" & "timercmp" Help me!!!! Thanks a lot!! From ptp at lysator.liu.se Fri Aug 18 07:28:16 2006 From: ptp at lysator.liu.se (Tommy Pettersson) Date: Fri Aug 18 07:28:58 2006 Subject: [splint-discuss] Unrecognized macros like "timerisset" "timercmp" In-Reply-To: <1155893524.4953.23.camel@localhost> References: <1155893524.4953.23.camel@localhost> Message-ID: <20060818112816.GA23563@static-81.216.50.98.addr.tdcsong.se> On Fri, Aug 18, 2006 at 05:32:04PM +0800, raymond wrote: > splint +posixlib -skip-posix-headers test2.c [...] > test2.c:13:6: Unrecognized identifier: timerisset [...] > It seems splint can not recognize the macro in like > "timerisset" & "timercmp" Splint does not use sys/time.h. It uses internal libraries guaranteed to be compliant with the standard checked for. timerisset and timercmp are BSD extensions, not posix or ansi, so splint does right in not recognizing them in posix mode. There's a unixlib in splint, but it does not declare timerisset or timercmp. I don't know if it should. A portable solution would do something like checking if these macros are defined or else define them. Then your code really will compile in a posix environment. If you only want to make splint happy for the time being, you can define the macros just for splint within #ifdef S_SPLINT_S / #endif. -- Tommy Pettersson From raymond-xu at 126.com Sun Aug 20 22:13:24 2006 From: raymond-xu at 126.com (raymond) Date: Sun Aug 20 22:14:58 2006 Subject: [splint-discuss] Unrecognized macros like "timerisset" "timercmp" In-Reply-To: <20060818112816.GA23563@static-81.216.50.98.addr.tdcsong.se> References: <1155893524.4953.23.camel@localhost> <20060818112816.GA23563@static-81.216.50.98.addr.tdcsong.se> Message-ID: <1156126405.4875.15.camel@localhost> On Fri, 2006-08-18 at 13:28 +0200, Tommy Pettersson wrote: > On Fri, Aug 18, 2006 at 05:32:04PM +0800, raymond wrote: > > splint +posixlib -skip-posix-headers test2.c > [...] > > test2.c:13:6: Unrecognized identifier: timerisset > [...] > > It seems splint can not recognize the macro in like > > "timerisset" & "timercmp" > > Splint does not use sys/time.h. It uses internal libraries > guaranteed to be compliant with the standard checked for. > timerisset and timercmp are BSD extensions, not posix or ansi, > so splint does right in not recognizing them in posix mode. > > There's a unixlib in splint, but it does not declare timerisset > or timercmp. I don't know if it should. A portable solution > would do something like checking if these macros are defined or > else define them. Then your code really will compile in a posix > environment. If you only want to make splint happy for the time > being, you can define the macros just for splint within #ifdef > S_SPLINT_S / #endif. > > Thanks a lot, but I have another question when I declare a function in a header("timer.h") file like this: #include typedef struct timeval obj_timer; typedef obj_timer *p_timer; extern void _timer_set(p_timer tp, time_t sec, suseconds_t usec); then implement function like below(in "timer.c" file): #include "timer.h" obj_timer now; void _timer_set(p_timer tp, time_t sec, suseconds_t usec) { obj_timer incr; incr.tv_sec = sec; incr.tv_usec = usec; timeradd(&now, &incr, tp); } Checking the code("timer.c") with splint, it output : Splint 3.1.1 --- 06 Jan 2006 timer.h:20:59: Parse Error: Inconsistent function parameter syntax: suseconds_t : . (For help on parse errors, see splint -help parseerrors.) *** Cannot continue. Thanks a lot. From lholzheid at bihl-wiedemann.de Mon Aug 21 13:11:48 2006 From: lholzheid at bihl-wiedemann.de (Ludolf Holzheid) Date: Mon Aug 21 13:11:58 2006 Subject: [splint-discuss] Unrecognized macros like "timerisset" "timercmp" In-Reply-To: <1156126405.4875.15.camel@localhost> References: <1155893524.4953.23.camel@localhost> <20060818112816.GA23563@static-81.216.50.98.addr.tdcsong.se> <1156126405.4875.15.camel@localhost> Message-ID: <20060821171148.GA2291@svr5.bihl-wiedemann.de> On Mon, 2006-08-21 10:13:24 +0800, raymond wrote: > [..] > Checking the code("timer.c") with splint, it output : > > Splint 3.1.1 --- 06 Jan 2006 > > timer.h:20:59: Parse Error: Inconsistent function parameter > syntax: > suseconds_t : . (For help on parse errors, see splint > -help I suppose suseconds_t is not visible in POSIX. You may try to use the unix library (splint +unixlib). HTH, Ludolf -- --------------------------------------------------------------- Ludolf Holzheid Tel: +49 621 339960 Bihl+Wiedemann GmbH Fax: +49 621 3392239 Flo?w?rthstra?e 41 e-mail: lholzheid@bihl-wiedemann.de D-68199 Mannheim, Germany --------------------------------------------------------------- From raymond-xu at 126.com Mon Aug 21 21:14:25 2006 From: raymond-xu at 126.com (raymond) Date: Mon Aug 21 21:16:02 2006 Subject: [splint-discuss] Unrecognized macros like "timerisset" "timercmp" In-Reply-To: <20060821171148.GA2291@svr5.bihl-wiedemann.de> References: <1155893524.4953.23.camel@localhost> <20060818112816.GA23563@static-81.216.50.98.addr.tdcsong.se> <1156126405.4875.15.camel@localhost> <20060821171148.GA2291@svr5.bihl-wiedemann.de> Message-ID: <1156209265.4875.31.camel@localhost> On Mon, 2006-08-21 at 19:11 +0200, Ludolf Holzheid wrote: > On Mon, 2006-08-21 10:13:24 +0800, raymond wrote: > > [..] > > Checking the code("timer.c") with splint, it output : > > > > Splint 3.1.1 --- 06 Jan 2006 > > > > timer.h:20:59: Parse Error: Inconsistent function parameter > > syntax: > > suseconds_t : . (For help on parse errors, see splint > > -help > > I suppose suseconds_t is not visible in POSIX. You may try to use the > unix library (splint +unixlib). > > HTH, > > Ludolf > Yes, I think so. But is there options just to parse all header files in the analysis progress, because many projects not posix compatible but using some lib of posix like "pthread". From raymond-xu at 126.com Tue Aug 22 02:14:02 2006 From: raymond-xu at 126.com (raymond) Date: Tue Aug 22 02:15:39 2006 Subject: [splint-discuss] How fix "__gnuc_va_list" parse problem In-Reply-To: <1156209265.4875.31.camel@localhost> References: <1155893524.4953.23.camel@localhost> <20060818112816.GA23563@static-81.216.50.98.addr.tdcsong.se> <1156126405.4875.15.camel@localhost> <20060821171148.GA2291@svr5.bihl-wiedemann.de> <1156209265.4875.31.camel@localhost> Message-ID: <1156227242.4875.39.camel@localhost> When I parse some C file using splint as following cmd: splint +posixlib -preproc -skipisoheaders -skipposixheaders *.c it produces like below: Splint 3.0.1.7 --- 24 Jan 2003 /usr/include/libio.h:464:18: Parse Error: Inconsistent function parameter syntax: __gnuc_va_list : . (For help on parse errors, see splint -help parseerrors.) *** Cannot continue. Does someone help me out! Thanks advance ! From ptp at lysator.liu.se Tue Aug 22 05:15:08 2006 From: ptp at lysator.liu.se (Tommy Pettersson) Date: Tue Aug 22 05:15:26 2006 Subject: [splint-discuss] Unrecognized macros like "timerisset" "timercmp" In-Reply-To: <1156209265.4875.31.camel@localhost> References: <1155893524.4953.23.camel@localhost> <20060818112816.GA23563@static-81.216.50.98.addr.tdcsong.se> <1156126405.4875.15.camel@localhost> <20060821171148.GA2291@svr5.bihl-wiedemann.de> <1156209265.4875.31.camel@localhost> Message-ID: <20060822091508.GA1129@static-81.216.50.98.addr.tdcsong.se> On Tue, Aug 22, 2006 at 09:14:25AM +0800, raymond wrote: > Yes, I think so. But is there options just to parse all header files in > the analysis progress, because many projects not posix compatible but > using some lib of posix like "pthread". Many library header files use trickery that fools splint. The elegant solution is to generate a library (.lcd) for splint, but it's a solution that requires a fair amount of work. You would basically rewrite the include file(s) for pthread without any trickery but with splint annotations. Look at the splint standard libraries include files and compare them with the system include files for example. Section 14.2 of the splint manual explains how to generate the library file from there. Then you would instruct splint _not_ to read the pthread include files but instead use this pthread library file. This will buy you checking for proper use of the pthread library (which splint by default only offers for the standard libraries in ansi, posix and to some extent unix). I use a more self-centered and time preserving approach; I make a per project splint library with _only_ the extra stuff I use, all of it in one incompatibility library. It makes splint both run and do proper checking, but reusability is very low. -- Tommy Pettersson From ptp at lysator.liu.se Tue Aug 22 05:15:08 2006 From: ptp at lysator.liu.se (Tommy Pettersson) Date: Tue Aug 22 05:15:27 2006 Subject: [splint-discuss] Unrecognized macros like "timerisset" "timercmp" In-Reply-To: <1156209265.4875.31.camel@localhost> References: <1155893524.4953.23.camel@localhost> <20060818112816.GA23563@static-81.216.50.98.addr.tdcsong.se> <1156126405.4875.15.camel@localhost> <20060821171148.GA2291@svr5.bihl-wiedemann.de> <1156209265.4875.31.camel@localhost> Message-ID: <20060822091508.GA1129@static-81.216.50.98.addr.tdcsong.se> On Tue, Aug 22, 2006 at 09:14:25AM +0800, raymond wrote: > Yes, I think so. But is there options just to parse all header files in > the analysis progress, because many projects not posix compatible but > using some lib of posix like "pthread". Many library header files use trickery that fools splint. The elegant solution is to generate a library (.lcd) for splint, but it's a solution that requires a fair amount of work. You would basically rewrite the include file(s) for pthread without any trickery but with splint annotations. Look at the splint standard libraries include files and compare them with the system include files for example. Section 14.2 of the splint manual explains how to generate the library file from there. Then you would instruct splint _not_ to read the pthread include files but instead use this pthread library file. This will buy you checking for proper use of the pthread library (which splint by default only offers for the standard libraries in ansi, posix and to some extent unix). I use a more self-centered and time preserving approach; I make a per project splint library with _only_ the extra stuff I use, all of it in one incompatibility library. It makes splint both run and do proper checking, but reusability is very low. -- Tommy Pettersson From shaojiping at gmail.com Wed Aug 23 22:37:17 2006 From: shaojiping at gmail.com (jiping shao) Date: Wed Aug 23 22:37:22 2006 Subject: [splint-discuss] Preprocessing error , need help Message-ID: I am a newbie to splint , now I need some help , i run the following command: $ splint +gnuextensions -I/usr/include/glib-2.0/ -I/home/alex/svn/prj6_ha2/tags/tag1/module/heartbeat/include/ -I/home/alex/svn/prj6_ha2/branches/module/ha_code/contrib/grm/ -I/home/alex/svn/prj6_ha2/tags/tag1/module/heartbeat/contrib/nrm/ -I/home/alex/svn/prj6_ha2/trunk/module/heartbeat/libltdl +posixlib nrmd.c and the output error like this: Splint 3.1.1 --- 22 Aug 2006 Command Line: Setting +gnuextensions redundant with current value nrmd.c:18:25: Cannot find include file portability.h on search path: /usr/include/glib-2.0 /;/home/alex/svn/prj6_ha2/tags/tag1/module/heartbeat/in clude/;/home/alex/svn/prj6_ha2/branches/module/ha_code/contrib/grm/;/home/al ex/svn/prj6_ha2/tags/tag1/module/heartbeat/contrib/nrm/;/home/alex/svn/prj6_ ha2/trunk/module/heartbeat/libltdl;/usr/include;/usr/include Preprocessing error. (Use -preproc to inhibit warning) ../../../../../tags/tag1/module/heartbeat/include/heartbeat.h:77:66: #error "Syslog.h does not define either LOG_PRI or LOG_PRIMASK." In file included from nrmd.c:37 ../../../../../tags/tag1/module/heartbeat/contrib/nrm/nrm_api.h:27:25: Cannot find include file portability.h on search path: /usr/include/glib-2.0 /;/home/alex/svn/prj6_ha2/tags/tag1/module/heartbeat/in clude/;/home/alex/svn/prj6_ha2/branches/module/ha_code/contrib/grm/;/home/al ex/svn/prj6_ha2/tags/tag1/module/heartbeat/contrib/nrm/;/home/alex/svn/prj6_ ha2/trunk/module/heartbeat/libltdl;/usr/include;/usr/include In file included from nrmd.c:54 ../../../../../tags/tag1/module/heartbeat/contrib/nrm/nrm_msg.h:35:25: Cannot find include file portability.h on search path: /usr/include/glib-2.0 /;/home/alex/svn/prj6_ha2/tags/tag1/module/heartbeat/in clude/;/home/alex/svn/prj6_ha2/branches/module/ha_code/contrib/grm/;/home/al ex/svn/prj6_ha2/tags/tag1/module/heartbeat/contrib/nrm/;/home/alex/svn/prj6_ ha2/trunk/module/heartbeat/libltdl;/usr/include;/usr/include In file included from nrmd.c:55 Preprocessing error for file: /home/alex/svn/prj6_ha2/branches/module/heartbeat/ contrib/nrm/nrmd.c *** Cannot continue. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.cs.Virginia.EDU/pipermail/splint-discuss/attachments/20060824/f1771470/attachment.htm From lholzheid at bihl-wiedemann.de Thu Aug 24 14:41:16 2006 From: lholzheid at bihl-wiedemann.de (Ludolf Holzheid) Date: Thu Aug 24 14:41:26 2006 Subject: [splint-discuss] Preprocessing error , need help In-Reply-To: References: Message-ID: <20060824184116.GA3137@svr5.bihl-wiedemann.de> On Thu, 2006-08-24 10:37:17 +0800, jiping shao wrote: > [..] > Splint 3.1.1 --- 22 Aug 2006 > > Command Line: Setting +gnuextensions redundant with current value Hello Jiping, This first message is a warning only, saying the '+gnuextensions' flag does not change anything (as it is the default). If you still want to specify '+gnuextensions' on the command line and you don't want to see this message, place a '-warnflags' flag left of '+gnuextensions'. > nrmd.c:18:25: Cannot find include file portability.h on search path: > /usr/include/... > Preprocessing error. (Use -preproc to inhibit warning) This is a fatal error: Splint does not find 'portability.h' in the directories given as search path. > ../../../../../tags/tag1/module/heartbeat/include/heartbeat.h:77:66: > #error "Syslog.h does not define either LOG_PRI or LOG_PRIMASK." > In file included from nrmd.c:37 In 'heartbeat.h', it is checked whether LOG_PRI or LOG_PRIMASK is defined. They are not (maybe due to the missing header). Reaching an #error directive is regarded as a fatal error. This is a fatal error too. > ../../../../../tags/tag1/module/heartbeat/contrib/nrm/nrm_api.h:27:25: > Cannot find include file portability.h on search path: > /usr/include/... > In file included from nrmd.c:54 'portability.h' is missing again. > ../../../../../tags/tag1/module/heartbeat/contrib/nrm/nrm_msg.h:35:25: > Cannot find include file portability.h on search path: > /usr/include/... > In file included from nrmd.c:55 'portability.h' should be included a third time. > Preprocessing error for file: > /home/alex/svn/prj6_ha2/branches/module/heartbeat/ > contrib/nrm/nrmd.c > *** Cannot continue. This final message means, splint bailed out after preprocessing phase. It's a proven strategy to take care for the first error message first, so try adding the path to 'portability.h' to the search path. OTOH, if 'nrmd.c' cannot be compiled (due to the compiler also chokes on the missing headers and failed tests), you may still run splint on it by specifying '-preproc' flag. (I'm not sure whether this would be meaningful, though). HTH, Ludolf -- --------------------------------------------------------------- Ludolf Holzheid Tel: +49 621 339960 Bihl+Wiedemann GmbH Fax: +49 621 3392239 Flo?w?rthstra?e 41 e-mail: lholzheid@bihl-wiedemann.de D-68199 Mannheim, Germany --------------------------------------------------------------- LocalWords: warnflags From shaojiping at gmail.com Thu Aug 24 22:45:19 2006 From: shaojiping at gmail.com (jiping shao) Date: Thu Aug 24 22:45:29 2006 Subject: [splint-discuss] Preprocessing error , need help In-Reply-To: <20060824184116.GA3137@svr5.bihl-wiedemann.de> References: <20060824184116.GA3137@svr5.bihl-wiedemann.de> Message-ID: Thanks for your help, now I solved the problem about include head file, but I got the error I still can't find a solution. $ splint -I/home/alex/svn/prj6_ha2/branches/module/ha_code/contrib/grm/ -I/home/alex/svn/prj6_ha2/trunk/module/heartbeat/libltdl -I/home/alex/svn/prj6_ha2/branches/module/heartbeat/linux-ha/ -I/usr/include/glib-2.0/ -I/home/alex/svn/prj6_ha2/branches/module/heartbeat/include/ -I/home/alex/svn/prj6_ha2/branches/module/heartbeat/contrib/nrm/ +posixlib -preproc nrmd.c Splint 3.1.1 --- 22 Aug 2006 /usr/include/arpa/inet.h:35:27: Parse Error. (For help on parse errors, see splint -help parseerrors.) *** Cannot continue. so , I run: $ cat -n /usr/include/arpa/inet.h | grep -3 35 32 33 /* Convert Internet host address from numbers-and-dots notation in CP 34 into binary data in network byte order. */ 35 extern in_addr_t inet_addr (__const char *__cp) __THROW; 36 37 /* Return the local host address part of the Internet address in IN. */ 38 extern in_addr_t inet_lnaof (struct in_addr __in) __THROW; I don't know why paser error at line 35, so ......:-) best regard! 2006/8/25, Ludolf Holzheid : > > On Thu, 2006-08-24 10:37:17 +0800, jiping shao wrote: > > [..] > > Splint 3.1.1 --- 22 Aug 2006 > > > > Command Line: Setting +gnuextensions redundant with current value > > Hello Jiping, > > This first message is a warning only, saying the '+gnuextensions' flag > does not change anything (as it is the default). > > If you still want to specify '+gnuextensions' on the command line and > you don't want to see this message, place a '-warnflags' flag left of > '+gnuextensions'. > > > nrmd.c:18:25: Cannot find include file portability.h on search path: > > /usr/include/... > > Preprocessing error. (Use -preproc to inhibit warning) > > This is a fatal error: Splint does not find 'portability.h' in the > directories given as search path. > > > ../../../../../tags/tag1/module/heartbeat/include/heartbeat.h:77:66: > > #error "Syslog.h does not define either LOG_PRI or LOG_PRIMASK." > > In file included from nrmd.c:37 > > In 'heartbeat.h', it is checked whether LOG_PRI or LOG_PRIMASK is > defined. They are not (maybe due to the missing header). Reaching an > #error directive is regarded as a fatal error. > > This is a fatal error too. > > > ../../../../../tags/tag1/module/heartbeat/contrib/nrm/nrm_api.h:27:25: > > Cannot find include file portability.h on search path: > > /usr/include/... > > In file included from nrmd.c:54 > > 'portability.h' is missing again. > > > ../../../../../tags/tag1/module/heartbeat/contrib/nrm/nrm_msg.h:35:25: > > Cannot find include file portability.h on search path: > > /usr/include/... > > In file included from nrmd.c:55 > > 'portability.h' should be included a third time. > > > Preprocessing error for file: > > /home/alex/svn/prj6_ha2/branches/module/heartbeat/ > > contrib/nrm/nrmd.c > > *** Cannot continue. > > This final message means, splint bailed out after preprocessing phase. > > > It's a proven strategy to take care for the first error message first, > so try adding the path to 'portability.h' to the search path. > > OTOH, if 'nrmd.c' cannot be compiled (due to the compiler also chokes > on the missing headers and failed tests), you may still run splint on > it by specifying '-preproc' flag. (I'm not sure whether this would be > meaningful, though). > > HTH, > > Ludolf > > -- > > --------------------------------------------------------------- > Ludolf Holzheid Tel: +49 621 339960 > Bihl+Wiedemann GmbH Fax: +49 621 3392239 > Flo?w?rthstra?e 41 e-mail: lholzheid@bihl-wiedemann.de > D-68199 Mannheim, Germany > --------------------------------------------------------------- > > LocalWords: warnflags > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.cs.Virginia.EDU/pipermail/splint-discuss/attachments/20060825/d3725cf6/attachment.htm From raymond-xu at 126.com Fri Aug 25 04:11:38 2006 From: raymond-xu at 126.com (raymond) Date: Fri Aug 25 04:13:18 2006 Subject: [splint-discuss] Unrecognized macros like "timerisset" "timercmp" In-Reply-To: <20060822091508.GA1129@static-81.216.50.98.addr.tdcsong.se> References: <1155893524.4953.23.camel@localhost> <20060818112816.GA23563@static-81.216.50.98.addr.tdcsong.se> <1156126405.4875.15.camel@localhost> <20060821171148.GA2291@svr5.bihl-wiedemann.de> <1156209265.4875.31.camel@localhost> <20060822091508.GA1129@static-81.216.50.98.addr.tdcsong.se> Message-ID: <1156493498.5575.4.camel@localhost> Thanks your advice. On Tue, 2006-08-22 at 11:15 +0200, Tommy Pettersson wrote: > On Tue, Aug 22, 2006 at 09:14:25AM +0800, raymond wrote: > > Yes, I think so. But is there options just to parse all header files in > > the analysis progress, because many projects not posix compatible but > > using some lib of posix like "pthread". > > Many library header files use trickery that fools splint. The > elegant solution is to generate a library (.lcd) for splint, but > it's a solution that requires a fair amount of work. You would > basically rewrite the include file(s) for pthread without any > trickery but with splint annotations. Look at the splint > standard libraries include files and compare them with the > system include files for example. Section 14.2 of the splint > manual explains how to generate the library file from there. > Then you would instruct splint _not_ to read the pthread include > files but instead use this pthread library file. This will buy > you checking for proper use of the pthread library (which splint > by default only offers for the standard libraries in ansi, posix > and to some extent unix). > > I use a more self-centered and time preserving approach; I make > a per project splint library with _only_ the extra stuff I use, > all of it in one incompatibility library. It makes splint both > run and do proper checking, but reusability is very low. > > From raymond-xu at 126.com Fri Aug 25 04:11:38 2006 From: raymond-xu at 126.com (raymond) Date: Fri Aug 25 04:13:23 2006 Subject: [splint-discuss] Unrecognized macros like "timerisset" "timercmp" In-Reply-To: <20060822091508.GA1129@static-81.216.50.98.addr.tdcsong.se> References: <1155893524.4953.23.camel@localhost> <20060818112816.GA23563@static-81.216.50.98.addr.tdcsong.se> <1156126405.4875.15.camel@localhost> <20060821171148.GA2291@svr5.bihl-wiedemann.de> <1156209265.4875.31.camel@localhost> <20060822091508.GA1129@static-81.216.50.98.addr.tdcsong.se> Message-ID: <1156493498.5575.4.camel@localhost> Thanks your advice. On Tue, 2006-08-22 at 11:15 +0200, Tommy Pettersson wrote: > On Tue, Aug 22, 2006 at 09:14:25AM +0800, raymond wrote: > > Yes, I think so. But is there options just to parse all header files in > > the analysis progress, because many projects not posix compatible but > > using some lib of posix like "pthread". > > Many library header files use trickery that fools splint. The > elegant solution is to generate a library (.lcd) for splint, but > it's a solution that requires a fair amount of work. You would > basically rewrite the include file(s) for pthread without any > trickery but with splint annotations. Look at the splint > standard libraries include files and compare them with the > system include files for example. Section 14.2 of the splint > manual explains how to generate the library file from there. > Then you would instruct splint _not_ to read the pthread include > files but instead use this pthread library file. This will buy > you checking for proper use of the pthread library (which splint > by default only offers for the standard libraries in ansi, posix > and to some extent unix). > > I use a more self-centered and time preserving approach; I make > a per project splint library with _only_ the extra stuff I use, > all of it in one incompatibility library. It makes splint both > run and do proper checking, but reusability is very low. > > From aabelka at gmail.com Fri Aug 25 04:59:07 2006 From: aabelka at gmail.com (ABDESSELEM Belkacem) Date: Fri Aug 25 04:59:16 2006 Subject: [splint-discuss] parse error Message-ID: <8586aeb00608250159v71247b59h39b2774675b8bb5b@mail.gmail.com> Hello, I'm a new guy in Splint. I have a problem when i parse my program with splint. I use the command: splint -I. -Iinclude -I/usr/X11R6/include/X11 -I/usr/X11R6/lib64 +posixlib src/*.c but it generate the following parse error: include/x11lib.h:82:1: Macro TBLUE already defined include/x11lib.h:73: Previous definition of TBLUE include/syslib.h:110:11: Parse Error. (For help on parse errors, see splint -help parseerrors.) *** Cannot continue. Please, Help me Belkacem -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.cs.Virginia.EDU/pipermail/splint-discuss/attachments/20060825/bd733375/attachment.htm From lholzheid at bihl-wiedemann.de Fri Aug 25 09:11:40 2006 From: lholzheid at bihl-wiedemann.de (Ludolf Holzheid) Date: Fri Aug 25 09:11:50 2006 Subject: [splint-discuss] Preprocessing error , need help In-Reply-To: References: <20060824184116.GA3137@svr5.bihl-wiedemann.de> Message-ID: <20060825131140.GA11260@svr5.bihl-wiedemann.de> On Fri, 2006-08-25 10:45:19 +0800, jiping shao wrote: > [..] > /usr/include/arpa/inet.h:35:27: Parse Error. (For help on parse errors, see > splint -help parseerrors.) > *** Cannot continue. Usually, splint does not use system headers for two reasons: (1) The system headers are not intended to be parse-able by compilers other than the system one (so they often use proprietary extensions). (2) Splint works best on annotated source. The *.lcd libraries used by splint instead of the system headers are created from annotated headers (see e.g. lib/unix.h). You might use the '+skipsysheaders' and '-sysdirs /usr/include' flags to tell splint which are the system headers to skip. Ludolf -- --------------------------------------------------------------- Ludolf Holzheid Tel: +49 621 339960 Bihl+Wiedemann GmbH Fax: +49 621 3392239 Flo?w?rthstra?e 41 e-mail: lholzheid@bihl-wiedemann.de D-68199 Mannheim, Germany --------------------------------------------------------------- From lholzheid at bihl-wiedemann.de Fri Aug 25 14:48:08 2006 From: lholzheid at bihl-wiedemann.de (Ludolf Holzheid) Date: Fri Aug 25 14:48:20 2006 Subject: [splint-discuss] parse error In-Reply-To: <8586aeb00608250159v71247b59h39b2774675b8bb5b@mail.gmail.com> References: <8586aeb00608250159v71247b59h39b2774675b8bb5b@mail.gmail.com> Message-ID: <20060825184808.GC11260@svr5.bihl-wiedemann.de> On Fri, 2006-08-25 10:59:07 +0200, ABDESSELEM Belkacem wrote: > [..] > but it generate the following parse error: > > include/x11lib.h:82:1: Macro TBLUE already defined > include/x11lib.h:73: Previous definition of TBLUE Belkacem, This first message reports redefining the symbol TBLUE to a value different to the one in line 73 (without undefining in between). > include/syslib.h:110:11: Parse Error. (For help on parse errors, see splint > -help parseerrors.) > *** Cannot continue. And this is second message is a parsing error message, which is fatal as long as the '-preproc' flag is not given. Inspect the offending line (include/syslib.h, line 110, column 11) and read the output of splint -help parseerrors. Hope this helps, Ludolf -- --------------------------------------------------------------- Ludolf Holzheid Tel: +49 621 339960 Bihl+Wiedemann GmbH Fax: +49 621 3392239 Flo?w?rthstra?e 41 e-mail: lholzheid@bihl-wiedemann.de D-68199 Mannheim, Germany --------------------------------------------------------------- From aabelka at gmail.com Mon Aug 28 02:56:22 2006 From: aabelka at gmail.com (ABDESSELEM Belkacem) Date: Mon Aug 28 02:56:29 2006 Subject: [splint-discuss] parse error In-Reply-To: <20060825184808.GC11260@svr5.bihl-wiedemann.de> References: <8586aeb00608250159v71247b59h39b2774675b8bb5b@mail.gmail.com> <20060825184808.GC11260@svr5.bihl-wiedemann.de> Message-ID: <8586aeb00608272356qbd103dg79c695d63b88b9b1@mail.gmail.com> Hi, in the line 110 column 11, there is a declaration of addr_t variable. do splint not reconize system types. thank you for your help On 8/25/06, Ludolf Holzheid wrote: > > On Fri, 2006-08-25 10:59:07 +0200, ABDESSELEM Belkacem wrote: > > [..] > > but it generate the following parse error: > > > > include/x11lib.h:82:1: Macro TBLUE already defined > > include/x11lib.h:73: Previous definition of TBLUE > > Belkacem, > > This first message reports redefining the symbol TBLUE to a value > different to the one in line 73 (without undefining in between). > > > include/syslib.h:110:11: Parse Error. (For help on parse errors, see > splint > > -help parseerrors.) > > *** Cannot continue. > > And this is second message is a parsing error message, which is fatal > as long as the '-preproc' flag is not given. > > > Inspect the offending line (include/syslib.h, line 110, column 11) and > read the output of splint -help parseerrors. > > > Hope this helps, > > Ludolf > > -- > > --------------------------------------------------------------- > Ludolf Holzheid Tel: +49 621 339960 > Bihl+Wiedemann GmbH Fax: +49 621 3392239 > Flo?w?rthstra?e 41 e-mail: lholzheid@bihl-wiedemann.de > D-68199 Mannheim, Germany > --------------------------------------------------------------- > > -- B. Abdesselem -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.cs.Virginia.EDU/pipermail/splint-discuss/attachments/20060828/43d62b87/attachment.htm From lholzheid at bihl-wiedemann.de Mon Aug 28 09:51:50 2006 From: lholzheid at bihl-wiedemann.de (Ludolf Holzheid) Date: Mon Aug 28 09:51:59 2006 Subject: [splint-discuss] parse error In-Reply-To: <8586aeb00608272356qbd103dg79c695d63b88b9b1@mail.gmail.com> References: <8586aeb00608250159v71247b59h39b2774675b8bb5b@mail.gmail.com> <20060825184808.GC11260@svr5.bihl-wiedemann.de> <8586aeb00608272356qbd103dg79c695d63b88b9b1@mail.gmail.com> Message-ID: <20060828135150.GA12551@svr5.bihl-wiedemann.de> On Mon, 2006-08-28 08:56:22 +0200, ABDESSELEM Belkacem wrote: > [..] > in the line 110 column 11, there is a declaration of addr_t variable. > do splint not reconize system types. Hello Belkacem, addr_t is neither ISO nor POSIX, but part of the 'Open Group Single UNIX Specification'. You'll have to use the unix library (+unixlib) to check your code. Ludolf -- --------------------------------------------------------------- Ludolf Holzheid Tel: +49 621 339960 Bihl+Wiedemann GmbH Fax: +49 621 3392239 Flo?w?rthstra?e 41 e-mail: lholzheid@bihl-wiedemann.de D-68199 Mannheim, Germany --------------------------------------------------------------- From aabelka at gmail.com Mon Aug 28 10:03:46 2006 From: aabelka at gmail.com (ABDESSELEM Belkacem) Date: Mon Aug 28 10:03:53 2006 Subject: [splint-discuss] parse error In-Reply-To: <20060828135150.GA12551@svr5.bihl-wiedemann.de> References: <8586aeb00608250159v71247b59h39b2774675b8bb5b@mail.gmail.com> <20060825184808.GC11260@svr5.bihl-wiedemann.de> <8586aeb00608272356qbd103dg79c695d63b88b9b1@mail.gmail.com> <20060828135150.GA12551@svr5.bihl-wiedemann.de> Message-ID: <8586aeb00608280703j267593afw490c1036fb68c79f@mail.gmail.com> it work now, thank you very much for your help. Belkacem On 8/28/06, Ludolf Holzheid wrote: > > On Mon, 2006-08-28 08:56:22 +0200, ABDESSELEM Belkacem wrote: > > [..] > > in the line 110 column 11, there is a declaration of addr_t variable. > > do splint not reconize system types. > > Hello Belkacem, > > addr_t is neither ISO nor POSIX, but part of the 'Open Group Single > UNIX Specification'. You'll have to use the unix library (+unixlib) to > check your code. > > Ludolf > > -- > > --------------------------------------------------------------- > Ludolf Holzheid Tel: +49 621 339960 > Bihl+Wiedemann GmbH Fax: +49 621 3392239 > Flo?w?rthstra?e 41 e-mail: lholzheid@bihl-wiedemann.de > D-68199 Mannheim, Germany > --------------------------------------------------------------- > > _______________________________________________ > splint-discuss mailing list > splint-discuss@ares.cs.Virginia.EDU > http://www.cs.Virginia.EDU/mailman-2.1.5/listinfo/splint-discuss > -- B. Abdesselem -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.cs.Virginia.EDU/pipermail/splint-discuss/attachments/20060828/81c871e0/attachment.htm From aabelka at gmail.com Mon Aug 28 10:03:46 2006 From: aabelka at gmail.com (ABDESSELEM Belkacem) Date: Mon Aug 28 10:03:55 2006 Subject: [splint-discuss] parse error In-Reply-To: <20060828135150.GA12551@svr5.bihl-wiedemann.de> References: <8586aeb00608250159v71247b59h39b2774675b8bb5b@mail.gmail.com> <20060825184808.GC11260@svr5.bihl-wiedemann.de> <8586aeb00608272356qbd103dg79c695d63b88b9b1@mail.gmail.com> <20060828135150.GA12551@svr5.bihl-wiedemann.de> Message-ID: <8586aeb00608280703j267593afw490c1036fb68c79f@mail.gmail.com> it work now, thank you very much for your help. Belkacem On 8/28/06, Ludolf Holzheid wrote: > > On Mon, 2006-08-28 08:56:22 +0200, ABDESSELEM Belkacem wrote: > > [..] > > in the line 110 column 11, there is a declaration of addr_t variable. > > do splint not reconize system types. > > Hello Belkacem, > > addr_t is neither ISO nor POSIX, but part of the 'Open Group Single > UNIX Specification'. You'll have to use the unix library (+unixlib) to > check your code. > > Ludolf > > -- > > --------------------------------------------------------------- > Ludolf Holzheid Tel: +49 621 339960 > Bihl+Wiedemann GmbH Fax: +49 621 3392239 > Flo?w?rthstra?e 41 e-mail: lholzheid@bihl-wiedemann.de > D-68199 Mannheim, Germany > --------------------------------------------------------------- > > _______________________________________________ > splint-discuss mailing list > splint-discuss@ares.cs.Virginia.EDU > http://www.cs.Virginia.EDU/mailman-2.1.5/listinfo/splint-discuss > -- B. Abdesselem -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.cs.Virginia.EDU/pipermail/splint-discuss/attachments/20060828/81c871e0/attachment-0001.htm From ok at cs.otago.ac.nz Mon Aug 28 21:05:59 2006 From: ok at cs.otago.ac.nz (Richard A. O'Keefe) Date: Mon Aug 28 21:06:13 2006 Subject: [splint-discuss] parse error Message-ID: <200608290105.k7T15xXW289804@atlas.otago.ac.nz> in the line 110 column 11, there is a declaration of addr_t variable. do splint not reconize system types. addr_t is not a built in language type. It is just another typedef, as if you had written typedef char *addr_t; /* Classic */ or typedef void *addr_t; /* C89 */ Splint will recognise it just like it recognises any other typedef name, that is, IF it has been correctly declared. Look a little wider. What other tokens are nearby? From aabelka at gmail.com Tue Aug 29 02:45:25 2006 From: aabelka at gmail.com (ABDESSELEM Belkacem) Date: Tue Aug 29 02:45:31 2006 Subject: [splint-discuss] parse error In-Reply-To: <200608290105.k7T15xXW289804@atlas.otago.ac.nz> References: <200608290105.k7T15xXW289804@atlas.otago.ac.nz> Message-ID: <8586aeb00608282345n414f4017i1cb7805d5b894466@mail.gmail.com> I have resolve the problem. i have added +unixlib in the command. thank you very mech for your help On 8/29/06, Richard A. O'Keefe wrote: > > in the line 110 column 11, there is a declaration of addr_t > variable. > do splint not reconize system types. > > addr_t is not a built in language type. > It is just another typedef, as if you had written > typedef char *addr_t; /* Classic */ > or > typedef void *addr_t; /* C89 */ > Splint will recognise it just like it recognises any other typedef name, > that is, IF it has been correctly declared. > > Look a little wider. What other tokens are nearby? > _______________________________________________ > splint-discuss mailing list > splint-discuss@ares.cs.Virginia.EDU > http://www.cs.Virginia.EDU/mailman-2.1.5/listinfo/splint-discuss > -- B. Abdesselem -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.cs.Virginia.EDU/pipermail/splint-discuss/attachments/20060829/98256870/attachment.htm