From vaclavpe at seznam.cz Fri Dec 4 05:46:56 2009 From: vaclavpe at seznam.cz (=?us-ascii?Q?Vaclav=20Peroutka?=) Date: Fri, 04 Dec 2009 11:46:56 +0100 (CET) Subject: [splint-discuss] Splint strange behaviour - what is wrong ? Message-ID: <3772.7133-29958-382937536-1259923616@seznam.cz> Hello all, I unpacked recent version of splint for Win32 and tried some test. But I am getting strange message: Splint 3.1.1 --- 12 April 2003 include\nrkapi.h(479,42): Semantic comment unrecognized: 4 Word after a stylized comment marker does not correspond to a stylized comment. (Use -unrecogcomments to inhibit warning) include\nrkapi.h(508,60): Semantic comment unrecognized: 5 include\nrkapi.h(1287,21): Parse Error. (For help on parse errors, see splint -help parseerrors.) *** Cannot continue. But on these lines there is IMHO nothing bad: #define _TK_NEW_PROPERTY_VALUE_WRONG 0XFF010014 #define _SUB_END_WITH_TIME_LIMIT 0xff010026 typedef void (*FsStatusCBP)(Int32 parSet,UInt32 parStatus); Even if I comment out the line 479, I get the same error. Can I somehow debug this problem ? Thank you in advance, Vaclav From elfring at users.sourceforge.net Fri Dec 4 11:00:55 2009 From: elfring at users.sourceforge.net (SF Markus Elfring) Date: Fri, 04 Dec 2009 17:00:55 +0100 Subject: [splint-discuss] Splint strange behaviour - what is wrong ? Message-ID: <1461553847@web.de> > But on these lines there is IMHO nothing bad: > #define _TK_NEW_PROPERTY_VALUE_WRONG 0XFF010014 > #define _SUB_END_WITH_TIME_LIMIT 0xff010026 I am sorry that I can not help to resolve parsing errors so far. - I guess that you should present a bit more informations from your source files. But I see your source code example as an update candidate because of a potential for reserved identifier violations. Are the mentioned preprocessor symbols used for a compiler implementation? Would you like to check at more places if they conform to the naming conventions of the C programming language? http://www.open-std.org/JTC1/SC22/WG14/www/docs/n1124.pdf http://www.knosof.co.uk/cbook/ Regards, Markus From lholzheid at bihl-wiedemann.de Fri Dec 4 11:55:59 2009 From: lholzheid at bihl-wiedemann.de (Ludolf Holzheid) Date: Fri, 4 Dec 2009 17:55:59 +0100 Subject: [splint-discuss] Splint strange behaviour - what is wrong ? In-Reply-To: <3772.7133-29958-382937536-1259923616@seznam.cz> References: <3772.7133-29958-382937536-1259923616@seznam.cz> Message-ID: <20091204165559.GA17803@svr5.bihl-wiedemann.de> On Fri, 2009-12-04 11:46:56 +0100, Vaclav Peroutka wrote: > Hello all, > > I unpacked recent version of splint for Win32 and tried some test. But I am getting strange message: > > Splint 3.1.1 --- 12 April 2003 > > include\nrkapi.h(479,42): Semantic comment unrecognized: 4 > Word after a stylized comment marker does not correspond to a stylized > comment. (Use -unrecogcomments to inhibit warning) > include\nrkapi.h(508,60): Semantic comment unrecognized: 5 > include\nrkapi.h(1287,21): Parse Error. (For help on parse errors, see splint -help > parseerrors.) > *** Cannot continue. > > But on these lines there is IMHO nothing bad: > #define _TK_NEW_PROPERTY_VALUE_WRONG 0XFF010014 > #define _SUB_END_WITH_TIME_LIMIT 0xff010026 > typedef void (*FsStatusCBP)(Int32 parSet,UInt32 parStatus); > > Even if I comment out the line 479, I get the same error. This makes me think splint got confused some lines above. A 'stylized comment' starts with '/*@'. Is there something like that in your source? Ludolf -- --------------------------------------------------------------- Ludolf Holzheid Tel: +49 621 339960 Bihl+Wiedemann GmbH Fax: +49 621 3392239 Flo?w?rthstra?e 41 e-mail: lholzheid at bihl-wiedemann.de D-68199 Mannheim, Germany --------------------------------------------------------------- From splint at sympatico.ca Fri Dec 4 14:33:54 2009 From: splint at sympatico.ca (Bill Pringlemeir) Date: Fri, 04 Dec 2009 14:33:54 -0500 Subject: [splint-discuss] Splint strange behaviour - what is wrong ? References: <3772.7133-29958-382937536-1259923616@seznam.cz> Message-ID: <873a3qjzz1.fsf@sympatico.ca> On 4 Dec 2009, vaclavpe at seznam.cz wrote: > I unpacked recent version of splint for Win32 and tried some > test. But I am getting strange message: > Even if I comment out the line 479, I get the same error. > Can I somehow debug this problem ? As other posters have noted, you do not give enough information for other to answer your question. However, since your question is "How can I answer this question", I can give you a *possibly* correct answer. See the appendix B of the splint manual, section debug. http://www.splint.org/manual/html/appB.html Some helpful flags, grammar - Debug parsing. Prints bison generated debugging information. keep - Do not delete temporary files. nopp - Do not pre-process input files. showsourceloc - Display the source code location where a warning is produced. Also, I have seen that source will parse with one set of flags and not with another. This is usually related to macro processing directives (section "Macro Expansion"). There is usually some portion of the manual related to a specific section in this appendix. Specifically, I think if '+grammar' is used, the yacc parsing will be turned on and a specific reason for the parse error may be known. It may be that a macro has redefined some symbol and caused the parse error. The 'keep' flag is also useful. It will be in the '/tmp' directory typically. The name will be something like 'clXAbdDE.c' or some such. This file is the 'pre-processed' variant of the file. hth, Bill Pringlemeir -- The lack of reason is overcome by the passion of belief - Anonymous From splint at sympatico.ca Fri Dec 4 14:33:54 2009 From: splint at sympatico.ca (Bill Pringlemeir) Date: Fri, 04 Dec 2009 14:33:54 -0500 Subject: [splint-discuss] Splint strange behaviour - what is wrong ? References: <3772.7133-29958-382937536-1259923616@seznam.cz> Message-ID: <873a3qjzz1.fsf@sympatico.ca> On 4 Dec 2009, vaclavpe at seznam.cz wrote: > I unpacked recent version of splint for Win32 and tried some > test. But I am getting strange message: > Even if I comment out the line 479, I get the same error. > Can I somehow debug this problem ? As other posters have noted, you do not give enough information for other to answer your question. However, since your question is "How can I answer this question", I can give you a *possibly* correct answer. See the appendix B of the splint manual, section debug. http://www.splint.org/manual/html/appB.html Some helpful flags, grammar - Debug parsing. Prints bison generated debugging information. keep - Do not delete temporary files. nopp - Do not pre-process input files. showsourceloc - Display the source code location where a warning is produced. Also, I have seen that source will parse with one set of flags and not with another. This is usually related to macro processing directives (section "Macro Expansion"). There is usually some portion of the manual related to a specific section in this appendix. Specifically, I think if '+grammar' is used, the yacc parsing will be turned on and a specific reason for the parse error may be known. It may be that a macro has redefined some symbol and caused the parse error. The 'keep' flag is also useful. It will be in the '/tmp' directory typically. The name will be something like 'clXAbdDE.c' or some such. This file is the 'pre-processed' variant of the file. hth, Bill Pringlemeir -- The lack of reason is overcome by the passion of belief - Anonymous From vaclavpe at seznam.cz Mon Dec 7 02:10:17 2009 From: vaclavpe at seznam.cz (=?us-ascii?Q?Vaclav=20Peroutka?=) Date: Mon, 07 Dec 2009 08:10:17 +0100 (CET) Subject: [splint-discuss] Splint strange behaviour - what is wrong ? In-Reply-To: <20091204165559.GA17803@svr5.bihl-wiedemann.de> Message-ID: <3062.6038-5173-1403130186-1260169817@seznam.cz> > ---------------------------------------- > > This makes me think splint got confused some lines above. > > A 'stylized comment' starts with '/*@'. Is there something like that > in your source? > > Ludolf > Hello Ludolf, yes, I found it! I finally found the problems. But they were on other lines. It seems to me that splint wrongly counts some multi-line comments like /* first line of comment this is the second line of comment and this is third */ above is counted as single line. Thank you for help, Vaclav From splint at sympatico.ca Mon Dec 7 09:35:46 2009 From: splint at sympatico.ca (Bill Pringlemeir) Date: Mon, 07 Dec 2009 09:35:46 -0500 Subject: [splint-discuss] Splint strange behaviour - what is wrong ? In-Reply-To: <3062.6038-5173-1403130186-1260169817@seznam.cz> (Vaclav Peroutka's message of "Mon, 07 Dec 2009 08:10:17 +0100 (CET)") References: <3062.6038-5173-1403130186-1260169817@seznam.cz> Message-ID: <87ocmac0n1.fsf@sympatico.ca> On 7 Dec 2009, vaclavpe at seznam.cz wrote: >> Splint 3.1.1 --- 12 April 2003 > yes, I found it! I finally found the problems. But they were on > other lines. It seems to me that splint wrongly counts some > multi-line comments like /* first line of comment this is the second > line of comment and this is third */ above is counted as single > line. This has been fixed in later versions of splint; at least my memory serves seeing some comment related to this. You could try version 3.1.2 and the CVS distribution to see which one fixes this problem. If it still exists (in CVS), I would be interested. Regards, Bill Pringlemeir. -- Little girls, like butterflies need no excuses. - Robert Heinlein From mail654 at gmx.de Fri Dec 18 08:37:17 2009 From: mail654 at gmx.de (mail654 at gmx.de) Date: Fri, 18 Dec 2009 14:37:17 +0100 Subject: [splint-discuss] Annotations in 3rd patry headers? Message-ID: <20091218133717.255250@gmx.net> Hi, I have a question regarding linting my code that uses 3rd party code. I get the 3rd party code without any annotation and I don't want to add annotations into this headers, because the 3rd party code shall not be changed. I use some functions that will get a pointer argument and will define the pointer or set the value behind. E.g. (simplified): 1 { 2 int SubscriberID; 3 4 XXXX_GetSubscriberID(Handle,&SubscriberID); 5 6 Err = XXXX_OpenSubscriber(SubscriberID); 7 8 } Splint will complain in line 6: "Variable SubscriberID used before definition". What could I do to prevent this warning beside of annotate the 3rd party header, that is not allowed and setting the value in line 2 to a default, that will increase the footprint of the binary if such functions occur on many places in my code. Is there any possibility that I missed? Kind regards, Erik -- Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 - sicherer, schneller und einfacher! http://portal.gmx.net/de/go/atbrowser From plongstaff at rogers.com Fri Dec 18 09:03:06 2009 From: plongstaff at rogers.com (Phil Longstaff) Date: Fri, 18 Dec 2009 06:03:06 -0800 (PST) Subject: [splint-discuss] Annotations in 3rd patry headers? In-Reply-To: <20091218133717.255250@gmx.net> References: <20091218133717.255250@gmx.net> Message-ID: <354626.8172.qm@web88102.mail.re2.yahoo.com> What I did for 3rd party headers is copy the definition to my own file splint_headers.h and add the annotations there. Phil ________________________________ From: "mail654 at gmx.de" To: splint-discuss at mail.cs.virginia.edu Sent: Fri, December 18, 2009 8:37:17 AM Subject: [splint-discuss] Annotations in 3rd patry headers? Hi, I have a question regarding linting my code that uses 3rd party code. I get the 3rd party code without any annotation and I don't want to add annotations into this headers, because the 3rd party code shall not be changed. I use some functions that will get a pointer argument and will define the pointer or set the value behind. E.g. (simplified): 1 { 2 int SubscriberID; 3 4 XXXX_GetSubscriberID(Handle,&SubscriberID); 5 6 Err = XXXX_OpenSubscriber(SubscriberID); 7 8 } Splint will complain in line 6: "Variable SubscriberID used before definition". What could I do to prevent this warning beside of annotate the 3rd party header, that is not allowed and setting the value in line 2 to a default, that will increase the footprint of the binary if such functions occur on many places in my code. Is there any possibility that I missed? Kind regards, Erik -- Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 - sicherer, schneller und einfacher! http://portal.gmx.net/de/go/atbrowser _______________________________________________ splint-discuss mailing list splint-discuss at mail.cs.virginia.edu http://www.cs.virginia.edu/mailman/listinfo/splint-discuss -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.cs.virginia.edu/pipermail/splint-discuss/attachments/20091218/6227c0ae/attachment.html From plongstaff at rogers.com Fri Dec 18 09:03:06 2009 From: plongstaff at rogers.com (Phil Longstaff) Date: Fri, 18 Dec 2009 06:03:06 -0800 (PST) Subject: [splint-discuss] Annotations in 3rd patry headers? In-Reply-To: <20091218133717.255250@gmx.net> References: <20091218133717.255250@gmx.net> Message-ID: <354626.8172.qm@web88102.mail.re2.yahoo.com> What I did for 3rd party headers is copy the definition to my own file splint_headers.h and add the annotations there. Phil ________________________________ From: "mail654 at gmx.de" To: splint-discuss at mail.cs.virginia.edu Sent: Fri, December 18, 2009 8:37:17 AM Subject: [splint-discuss] Annotations in 3rd patry headers? Hi, I have a question regarding linting my code that uses 3rd party code. I get the 3rd party code without any annotation and I don't want to add annotations into this headers, because the 3rd party code shall not be changed. I use some functions that will get a pointer argument and will define the pointer or set the value behind. E.g. (simplified): 1 { 2 int SubscriberID; 3 4 XXXX_GetSubscriberID(Handle,&SubscriberID); 5 6 Err = XXXX_OpenSubscriber(SubscriberID); 7 8 } Splint will complain in line 6: "Variable SubscriberID used before definition". What could I do to prevent this warning beside of annotate the 3rd party header, that is not allowed and setting the value in line 2 to a default, that will increase the footprint of the binary if such functions occur on many places in my code. Is there any possibility that I missed? Kind regards, Erik -- Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 - sicherer, schneller und einfacher! http://portal.gmx.net/de/go/atbrowser _______________________________________________ splint-discuss mailing list splint-discuss at mail.cs.virginia.edu http://www.cs.virginia.edu/mailman/listinfo/splint-discuss -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.cs.virginia.edu/pipermail/splint-discuss/attachments/20091218/6227c0ae/attachment-0001.html From splint at sympatico.ca Fri Dec 18 10:20:58 2009 From: splint at sympatico.ca (Bill Pringlemeir) Date: Fri, 18 Dec 2009 10:20:58 -0500 Subject: [splint-discuss] Annotations in 3rd patry headers? In-Reply-To: <354626.8172.qm@web88102.mail.re2.yahoo.com> (Phil Longstaff's message of "Fri, 18 Dec 2009 06:03:06 -0800 (PST)") References: <20091218133717.255250@gmx.net> <354626.8172.qm@web88102.mail.re2.yahoo.com> Message-ID: <87hbroxq91.fsf@sympatico.ca> > Erik Wrote: > I have a question regarding linting my code that uses > 3rd party code. > I get the 3rd party code without any annotation and I don't > want to add annotations into this headers, because the 3rd party > code shall not be changed. On 18 Dec 2009, plongstaff at rogers.com wrote: > What I did for 3rd party headers is copy the definition to my own file > splint_headers.h and add the annotations there. Phil's idea will work. However, you might wish to try the same thing that splint does for standard headers. This is in the 'lib' directory of the source. So, you would create a file like 'vendor.h' with a snippet like this, XXXX_GetSubscriberID(vendor_handler_type Handle, /*@out@*/int &SubscriberID); You can accumulate all of the annotations that the vendor has, even if there are in different headers. Then run the command, splint -nof -nolib +impconj vendor.h -dump vendor Then when you are checking your code, add the line '-load vendor'. This is in chapter 14 of the manual under "Libraries and Header File inclusion". The splint rule is that the first annotation encountered is used and if another annotation is encountered that disagrees, an error results. The command above will make a 'pre-compiled' splint header that has all the annotation information included. You can include the other 'lib' headers in the vendor.h to get all annotations. I don't know if splint supports multiple '-load' commands. It would be possible for someone to make a 'glib' version of such libraries. I would suggest that you could submit this file as it would be useful to others using the library. It would benefit you as the other users would make corrections and extend the annotations. Fwiw, Bill Pringlemeir. See: http://www.splint.org/manual/html/sec14.html -- Married men live longer than single men, but married men are much more willing to die - Dilworth