From vaclavpe at seznam.cz Thu Oct 6 03:32:42 2011 From: vaclavpe at seznam.cz (=?us-ascii?Q?Vaclav=20Peroutka?=) Date: Thu, 06 Oct 2011 12:32:42 +0200 (CEST) Subject: [splint-discuss] splint and Cortex M3 libraries Message-ID: <283608.8524.19179-31360-1658248426-1317897162@seznam.cz> Hello, after several problems I want to run splint-3.1.2 on one embedded project using STM32. I have problem with some uint32_t rules - getting following messages: d:\opt\STM32F10x_StdPeriph_Lib\Libraries\CMSIS\CM3\CoreSupport\\core_cm3.h(1489, 50): No type before declaration name (implicit int type): uint32_t : static A variable declaration has no explicit type. The type is implicitly int. (Use -imptype to inhibit warning) d:\opt\STM32F10x_StdPeriph_Lib\Libraries\CMSIS\CM3\CoreSupport\\core_cm3.h(1489, 50): Parse Error. (For help on parse errors, see splint -help parseerrors.) *** Cannot continue. I am running splint with following command: \opt\splint-3.1.2\bin\splint.exe -I d:\opt\arm-2010q1\arm-none-eabi\include\ -I d:/opt/STM32F10x_StdPeriph_Lib/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x -I d:/opt/STM32F10x_StdPeriph_Lib/Libraries/CMSIS/CM3/CoreSupport/ -nestcomment -preproc -incondefs main I found that uint32_t is normally used. But only in this construct ( static __INLINE uint32_t NVIC_GetPriorityGrouping(void)) it causes problems. If I replace "uint32_t" to "unsigned long", splint happily advances to next lines. Did anybody run splint on STM32 header files? How should I constraint splint to have no problem with above mentioned syntax? Thank you, Vaclav From kasinathan at hotmail.com Thu Oct 6 17:28:28 2011 From: kasinathan at hotmail.com (Suresh Kasinathan) Date: Thu, 6 Oct 2011 17:28:28 -0700 Subject: [splint-discuss] How to run splint in solaris Message-ID: I'm running into issues when trying to run splint in solaris. I untar'ed the tar file and splint is in /splint-3.1.1/bin directory. I've set the LARCH_PATH and LCLIMPORTDIR environment variables. I've set the path to point to /splint-3.1.1/bin directory. When I run splint from my project source code directory, I see this error, splint network.c -bash: /usr/local/sbin/splint: Invalid argument Any help will be appreciated. TIA. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.cs.virginia.edu/pipermail/splint-discuss/attachments/20111006/647779af/attachment.html From Michael.Wojcik at microfocus.com Fri Oct 7 05:53:23 2011 From: Michael.Wojcik at microfocus.com (Michael Wojcik) Date: Fri, 7 Oct 2011 07:53:23 -0500 Subject: [splint-discuss] How to run splint in solaris In-Reply-To: References: Message-ID: <0AB4526732901E45B9B3A55FFD725D67A505C7@AUS-EXCHANGE.microfocus.com> > From: splint-discuss-bounces at cs.virginia.edu [mailto:splint-discuss- > bounces at cs.virginia.edu] On Behalf Of Suresh Kasinathan > Sent: Thursday, 06 October, 2011 20:28 > > I'm running into issues when trying to run splint in solaris. > > I untar'ed the tar file and splint is in /splint-3.1.1/bin directory. > I've set the LARCH_PATH and LCLIMPORTDIR environment variables. > I've set the path to point to /splint-3.1.1/bin directory. > > When I run splint from my project source code directory, I see this > error, > ?splint network.c > -bash: /usr/local/sbin/splint: Invalid argument Apparently you have a file /usr/local/sbin/splint; and either /usr/local/sbin is ahead of /splint-3.1.1/bin in your path, or /splint-3.1.1/bin/splint isn't executable. Or your bash shell has "splint" aliased to "/usr/local/sbin/splint". In any case, this is not a Splint issue; it's a problem with your shell and environment. Since we don't have access to either, there's not much advice we can give. -- Michael Wojcik Principal Software Systems Developer, Micro Focus This message has been scanned by MailController - portal1.mailcontroller.co.uk From kasinathan at hotmail.com Fri Oct 7 11:28:26 2011 From: kasinathan at hotmail.com (Suresh Kasinathan) Date: Fri, 7 Oct 2011 11:28:26 -0700 Subject: [splint-discuss] How to run splint in solaris In-Reply-To: <0AB4526732901E45B9B3A55FFD725D67A505C7@AUS-EXCHANGE.microfocus.com> References: , <0AB4526732901E45B9B3A55FFD725D67A505C7@AUS-EXCHANGE.microfocus.com> Message-ID: Hi Michael, I should have added this information in my original post. I copied the splint binary from /splint-3.1.1/bin/ directory to /usr/local/sbin/. Even if I use explicit path, I see the same error i.e /splint-3.1.1/bin/splint foobar.c /splint-3.1.1/bin/splint network.c -bash: /splint-3.1.1/bin/splint: Invalid argument Thanks. > Date: Fri, 7 Oct 2011 07:53:23 -0500 > From: Michael.Wojcik at microfocus.com > To: splint-discuss at cs.virginia.edu > Subject: Re: [splint-discuss] How to run splint in solaris > > > From: splint-discuss-bounces at cs.virginia.edu [mailto:splint-discuss- > > bounces at cs.virginia.edu] On Behalf Of Suresh Kasinathan > > Sent: Thursday, 06 October, 2011 20:28 > > > > I'm running into issues when trying to run splint in solaris. > > > > I untar'ed the tar file and splint is in /splint-3.1.1/bin directory. > > I've set the LARCH_PATH and LCLIMPORTDIR environment variables. > > I've set the path to point to /splint-3.1.1/bin directory. > > > > When I run splint from my project source code directory, I see this > > error, > > splint network.c > > -bash: /usr/local/sbin/splint: Invalid argument > > Apparently you have a file /usr/local/sbin/splint; and either /usr/local/sbin is ahead of /splint-3.1.1/bin in your path, or /splint-3.1.1/bin/splint isn't executable. Or your bash shell has "splint" aliased to "/usr/local/sbin/splint". > > In any case, this is not a Splint issue; it's a problem with your shell and environment. Since we don't have access to either, there's not much advice we can give. > > > -- > Michael Wojcik > Principal Software Systems Developer, Micro Focus > > > This message has been scanned by MailController - portal1.mailcontroller.co.uk > _______________________________________________ > 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/20111007/2b5092a8/attachment.html From Michael.Wojcik at microfocus.com Sat Oct 8 07:04:36 2011 From: Michael.Wojcik at microfocus.com (Michael Wojcik) Date: Sat, 8 Oct 2011 09:04:36 -0500 Subject: [splint-discuss] How to run splint in solaris In-Reply-To: References: , <0AB4526732901E45B9B3A55FFD725D67A505C7@AUS-EXCHANGE.microfocus.com> Message-ID: <0AB4526732901E45B9B3A55FFD725D67A505CD@AUS-EXCHANGE.microfocus.com> > From: splint-discuss-bounces at cs.virginia.edu [mailto:splint-discuss- > bounces at cs.virginia.edu] On Behalf Of Suresh Kasinathan > Sent: Friday, 07 October, 2011 14:28 > To: splint-discuss at cs.virginia.edu > Subject: Re: [splint-discuss] How to run splint in solaris > > I should have added this information in my original post.? I copied the > splint binary from /splint-3.1.1/bin/ directory to /usr/local/sbin/. > Even if I use explicit path, I see the same error i.e? /splint- > 3.1.1/bin/splint foobar.c > > /splint-3.1.1/bin/splint network.c > -bash: /splint-3.1.1/bin/splint: Invalid argument Do you have execute permission for /splint-3.1.1/bin/splint? Is it a valid binary for your system? Again, this is not a Splint issue. It's an OS issue. -- Michael Wojcik Principal Software Systems Developer, Micro Focus This message has been scanned by MailController - portal1.mailcontroller.co.uk From r.albert at perma-tec.de Tue Oct 11 02:49:46 2011 From: r.albert at perma-tec.de (Ralf Albert) Date: Tue, 11 Oct 2011 09:49:46 +0000 Subject: [splint-discuss] Behaviour of interpreting numbers in comparisons on small embedded systems Message-ID: <0010047D.4E942D59@smtp.coco.perma-tec.de> I want to use SPLINT on my C-code for a 8bit Microcontroller. My code looks like this: { unsigned char tmp = 2; unsigned char tmp2 = 0x30 + tmp; } I get the SPLINT results: Variable tmp initialized to type int, expects unsigned char: 2 To make char and int types equivalent, use +charint. Incompatible types for + (int, unsigned char): 0x30 + tmp Now my question: SPLINT seems to interpret "2" and "0x30" as an integer (2-Byte) constant. In 8bit systems those numbers are usually interpreted as 1-Byte values. I tried "+relaxquals" and get Variable tmp initialized to type int, expects unsigned char: 2 Incompatible types for + (int, unsigned char): 0x30 + tmp In addition I tried "+charint" and get Variable tmp2 initialized to type int, expects unsigned char: 0x30 + tmp How can I set SPLINT to take all values 0...255 as 1-Byte-values? Kind regards Ralf -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.cs.virginia.edu/pipermail/splint-discuss/attachments/20111011/8c8e0c6a/attachment.html From lholzheid at bihl-wiedemann.de Tue Oct 11 09:50:49 2011 From: lholzheid at bihl-wiedemann.de (Ludolf Holzheid) Date: Tue, 11 Oct 2011 18:50:49 +0200 Subject: [splint-discuss] Behaviour of interpreting numbers in comparisons on small embedded systems In-Reply-To: <0010047D.4E942D59@smtp.coco.perma-tec.de> References: <0010047D.4E942D59@smtp.coco.perma-tec.de> Message-ID: <20111011165049.GB21772@shadow.bihl-wiedemann.de> On Tue, 2011-10-11 09:49:46 +0000, Ralf Albert wrote: > I want to use SPLINT on my C-code for a 8bit Microcontroller. > My code looks like this: > { > unsigned char tmp = 2; > unsigned char tmp2 = 0x30 + tmp; > } > > I get the SPLINT results: > Variable tmp initialized to type int, expects unsigned char: 2 > To make char and int types equivalent, use +charint. > Incompatible types for + (int, unsigned char): 0x30 + tmp > > Now my question: > SPLINT seems to interpret "2" and "0x30" as an integer (2-Byte) constant. This is what the C specification demands: "The type of an integer constant is the first of the corresponding list in which its value can be represented." and the corresponding list for not suffixed constants is "int", "long int" and "long long int" > In 8bit systems those numbers are usually interpreted as 1-Byte values. This was conforming to the C specification as long as an int is an 8-bit value (which I doubt). In this case, the correct way to code was: void My_code (void) { unsigned int tmp = 2u; unsigned int tmp2 = 0x30u + tmp; } If the "int" is an 16-bit value (as it is the case for e.g. Keil C51), you should write e.g. the following: void My_code (void) { unsigned char tmp = (unsigned char) 2u; unsigned char tmp2 = (unsigned char) 0x30u + tmp; } HTH, 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 ok at cs.otago.ac.nz Wed Oct 12 16:53:40 2011 From: ok at cs.otago.ac.nz (Richard O'Keefe) Date: Thu, 13 Oct 2011 12:53:40 +1300 Subject: [splint-discuss] Behaviour of interpreting numbers in comparisons on small embedded systems In-Reply-To: <0010047D.4E942D59@smtp.coco.perma-tec.de> References: <0010047D.4E942D59@smtp.coco.perma-tec.de> Message-ID: On 11/10/2011, at 10:49 PM, Ralf Albert wrote: > Now my question: > SPLINT seems to interpret "2" and "0x30" as an integer (2-Byte) constant. In standard C, 2 _is_ an int constant, and int is _at least_ 16 bits. The infuriating thing here is that splint appears to pay no attention to the _values_ of manifest expressions; while 2 has _type_ int the _value_ is perfectly compatible with unsigned char, and standard C has no unsigned char literals that you could use instead. For programs where assignments of literals to unsigned chars are rare, hacks like #define UC (unsigned char) unsigned char tmp = UC 2; are tolerable; where such assignments are very frequent I imagine such a hack will not be tolerable. > > > > How can I set SPLINT to take all values 0...255 as 1-Byte-values? Patch the source code? From r.albert at perma-tec.de Wed Oct 12 17:13:51 2011 From: r.albert at perma-tec.de (r.albert at perma-tec.de) Date: Thu, 13 Oct 2011 00:13:51 +0000 Subject: [splint-discuss] AUTOREPLY Re: Behaviour of interpreting numbers ... Message-ID: <00100AF2.4E96495F@smtp.coco.perma-tec.de> Vielen Dank fr Ihre email. Leider bin ich momentan nicht im Hause. Sie erreichen mich voraussichtlich wieder ab 14. Oktober 2011. Ihre email wird nicht automatisch weitergeleitet. Thank you for your email. I'm currently out of the office and will return to work on October 14. Your email will not be forwarded. Mit freundlichen Gren Best regards Dipl.Ing.(FH) Ralf Albert Forschung & Entwicklung Research & Development perma-tec GmbH & Co. KG Hammelburger Strae 21 97717 Euerdorf / Germany Tel.: +49 (0) 9704 609 3447 Fax: +49 (0) 9704 609 8 3447 E-mail: r.albert at perma-tec.de Homepage: www.perma-tec.com vertreten durch die geschftsfhrende Gesellschafterin perma-tec Verwaltungs-GmbH, Amtsgericht Schweinfurt HRB 3544 (persnlich haftend), diese vertreten durch die Geschftsfhrer Walter Graf und Peter Mayr Amtsgericht Schweinfurt HRA 3598 Umsatzsteuer-Identifikationsnummer: DE 812 792 039 On 11/10/2011, at 10:49 PM, Ralf Albert wrote: > Now my question: > SPLINT seems to interpret "2" and "0x30" as an integer (2-Byte) constant. In standard C, 2 _is_ an int constant, and int is _at least_ 16 bits. The infuriating thing here is that splint appears to pay no attention to the _values_ of manifest expressions; while 2 has _type_ int the _value_ is perfectly compatible with unsigned char, and standard C has no unsigned char literals that you could use instead. For programs where assignments of literals to unsigned chars are rare, hacks like #define UC (unsigned char) unsigned char tmp = UC 2; are tolerable; where such assignments are very frequent I imagine such a hack will not be tolerable. > > > > How can I set SPLINT to take all values 0...255 as 1-Byte-values? Patch the source code? _______________________________________________ splint-discuss mailing list splint-discuss at mail.cs.virginia.edu http://www.cs.virginia.edu/mailman/listinfo/splint-discuss To: splint-discuss at cs.virginia.edu Cc: splint-discuss at mail.cs.virginia.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.cs.virginia.edu/pipermail/splint-discuss/attachments/20111013/0e675a9a/attachment.html From ok at cs.otago.ac.nz Wed Oct 12 16:53:40 2011 From: ok at cs.otago.ac.nz (Richard O'Keefe) Date: Thu, 13 Oct 2011 12:53:40 +1300 Subject: [splint-discuss] Behaviour of interpreting numbers in comparisons on small embedded systems In-Reply-To: <0010047D.4E942D59@smtp.coco.perma-tec.de> References: <0010047D.4E942D59@smtp.coco.perma-tec.de> Message-ID: On 11/10/2011, at 10:49 PM, Ralf Albert wrote: > Now my question: > SPLINT seems to interpret "2" and "0x30" as an integer (2-Byte) constant. In standard C, 2 _is_ an int constant, and int is _at least_ 16 bits. The infuriating thing here is that splint appears to pay no attention to the _values_ of manifest expressions; while 2 has _type_ int the _value_ is perfectly compatible with unsigned char, and standard C has no unsigned char literals that you could use instead. For programs where assignments of literals to unsigned chars are rare, hacks like #define UC (unsigned char) unsigned char tmp = UC 2; are tolerable; where such assignments are very frequent I imagine such a hack will not be tolerable. > > > > How can I set SPLINT to take all values 0...255 as 1-Byte-values? Patch the source code? From tomi.pievilainen+splint at iki.fi Thu Oct 13 09:15:55 2011 From: tomi.pievilainen+splint at iki.fi (Tomi =?iso-8859-1?Q?Pievil=E4inen?=) Date: Thu, 13 Oct 2011 19:15:55 +0300 Subject: [splint-discuss] Splint cannot parse time_t? Message-ID: <20111013161555.GP3373@shirio.kyla.fi> I guess I'm missing something obvious, but I'm getting a parse error on the line " time_t start;" on the column before the variable name. Enabling posix or unixlibs didn't seem to do anything, and google failed me too so I need some outside help to solve the problem. -- Tomi Pievil?inen, +358 400 487 504 A: Because it disrupts the natural way of thinking. Q: Why is top posting frowned upon? -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature Url : http://www.cs.virginia.edu/pipermail/splint-discuss/attachments/20111013/2c36cfd6/attachment.bin