From pocmatos at gmail.com Fri May 7 04:35:28 2010 From: pocmatos at gmail.com (Paulo J. Matos) Date: Fri, 7 May 2010 12:35:28 +0100 Subject: [splint-discuss] Warnings for hidden mallocs causing leaks Message-ID: Hi all, I would like to know how it is possible to tell splint that a pointer returned by a function points to sz bytes of data and it is assumed that the caller should free the pointer when you don't have the source code of the callee. For example: char *callee(void); /* allocs 10 bytes, no source available */ void caller(void) { ... char * ptr = callee(); } <------------------------------- memory leak, 10 bytes not freed. Any tips? Cheers, -- PMatos From lholzheid at bihl-wiedemann.de Fri May 7 06:50:27 2010 From: lholzheid at bihl-wiedemann.de (Ludolf Holzheid) Date: Fri, 7 May 2010 15:50:27 +0200 Subject: [splint-discuss] Warnings for hidden mallocs causing leaks In-Reply-To: References: Message-ID: <20100507135026.GA25964@svr5.bihl-wiedemann.de> On Fri, 2010-05-07 12:35:28 +0100, Paulo J. Matos wrote: > Hi all, > > I would like to know how it is possible to tell splint that a pointer > returned by a function points to sz bytes of data and it is assumed > that the caller should free the pointer when you don't have the source > code of the callee. Isn't this what the /*@only@*/ annotation is for (see manual, section 5.2.1)? By the way, it doesn't make any difference whether the source of the callee is available or not. 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 pocmatos at gmail.com Fri May 7 08:40:40 2010 From: pocmatos at gmail.com (Paulo J. Matos) Date: Fri, 07 May 2010 16:40:40 +0100 Subject: [splint-discuss] Warnings for hidden mallocs causing leaks In-Reply-To: <20100507135026.GA25964@svr5.bihl-wiedemann.de> (Ludolf Holzheid's message of "Fri, 7 May 2010 15:50:27 +0200") References: <20100507135026.GA25964@svr5.bihl-wiedemann.de> Message-ID: Ludolf Holzheid writes: > On Fri, 2010-05-07 12:35:28 +0100, Paulo J. Matos wrote: > > Isn't this what the /*@only@*/ annotation is for (see manual, section > 5.2.1)? > > By the way, it doesn't make any difference whether the source of the > callee is available or not. > Thanks! I indeed looked at the /*@only@*/ annotation but didn't recognize it as a solution for this particular problem. Should read the fine manual more carefully. Thanks for your reply! -- PMatos From alok2.singh at aricent.com Mon May 10 21:13:58 2010 From: alok2.singh at aricent.com (Alok Singh) Date: Tue, 11 May 2010 09:43:58 +0530 Subject: [splint-discuss] Out put of splint in exel sheet and directly build with VC++ project In-Reply-To: References: <20100507135026.GA25964@svr5.bihl-wiedemann.de> Message-ID: <1C5C9E4F6D407B47B2D87C1DDFE3174D582F8332@GUREXMB01.ASIAN.AD.ARICENT.COM> Hi All, I am a new user of Splint. I am trying to run splint for Microsoft VC++ project which is written in C language. I have 2 query. 1- Can I build my VC++ solution with splint (Inbuild). 2- Can I take output of splint in Microsoft excel sheet. Currently I took out put in normal .txt file by using command Splint -preproc -I\Headerfile *.c > output.txt So can I take this output.txt in excel sheet. Thanks Alok "DISCLAIMER: This message is proprietary to Aricent and is intended solely for the use of the individual to whom it is addressed. It may contain privileged or confidential information and should not be circulated or used for any purpose other than for what it is intended. If you have received this message in error, please notify the originator immediately. If you are not the intended recipient, you are notified that you are strictly prohibited from using, copying, altering, or disclosing the contents of this message. Aricent accepts no responsibility for loss or damage arising from the use of the information transmitted by this email including damage from virus." From alok2.singh at aricent.com Mon May 10 21:13:58 2010 From: alok2.singh at aricent.com (Alok Singh) Date: Tue, 11 May 2010 09:43:58 +0530 Subject: [splint-discuss] Out put of splint in exel sheet and directly build with VC++ project In-Reply-To: References: <20100507135026.GA25964@svr5.bihl-wiedemann.de> Message-ID: <1C5C9E4F6D407B47B2D87C1DDFE3174D582F8332@GUREXMB01.ASIAN.AD.ARICENT.COM> Hi All, I am a new user of Splint. I am trying to run splint for Microsoft VC++ project which is written in C language. I have 2 query. 1- Can I build my VC++ solution with splint (Inbuild). 2- Can I take output of splint in Microsoft excel sheet. Currently I took out put in normal .txt file by using command Splint -preproc -I\Headerfile *.c > output.txt So can I take this output.txt in excel sheet. Thanks Alok "DISCLAIMER: This message is proprietary to Aricent and is intended solely for the use of the individual to whom it is addressed. It may contain privileged or confidential information and should not be circulated or used for any purpose other than for what it is intended. If you have received this message in error, please notify the originator immediately. If you are not the intended recipient, you are notified that you are strictly prohibited from using, copying, altering, or disclosing the contents of this message. Aricent accepts no responsibility for loss or damage arising from the use of the information transmitted by this email including damage from virus." From Wenzel at bbr-vt.de Tue May 11 02:18:23 2010 From: Wenzel at bbr-vt.de (Wenzel, Bodo) Date: Tue, 11 May 2010 11:18:23 +0200 Subject: [splint-discuss] Out put of splint in exel sheet and directly buildwith VC++ project In-Reply-To: <1C5C9E4F6D407B47B2D87C1DDFE3174D582F8332@GUREXMB01.ASIAN.AD.ARICENT.COM> References: <20100507135026.GA25964@svr5.bihl-wiedemann.de> <1C5C9E4F6D407B47B2D87C1DDFE3174D582F8332@GUREXMB01.ASIAN.AD.ARICENT.COM> Message-ID: <46B6459B655D7342AB97371E8B7CD8B8F4C7FB@sv-exch.BBR.local> Hi Alok, 1) You can setup the project settings such that additional tools are run. Depending when (custom build, pre-link, post-build) there are several possibilities. Please read the VisualStudio documentation, this is the Splint mailing list, not the VisualStudio mailing list... ;-) 2) What are you trying to achieve with the output in Excel? HTH Bodo Wenzel - Entwicklung Software - -- BBR - Baudis Bergmann R?sch Verkehrstechnik GmbH Pillaustra?e 1e D - 38126 Braunschweig T: +49.531.27300-766 F: +49.531.27300-999 @: wenzel at bbr-vt.de W: http://www.bbr-vt.de Registergericht: AG Braunschweig HRB 3037 Gesch?ftsf?hrer: Dipl.-Ing. Arne Baudis Dipl.-Ing. Thomas Bergmann Dipl.-Ing. Frank-Michael R?sch USt.-ID-Nr.: DE 114 877 881 From alok2.singh at aricent.com Tue May 11 03:31:00 2010 From: alok2.singh at aricent.com (Alok Singh) Date: Tue, 11 May 2010 16:01:00 +0530 Subject: [splint-discuss] Out put of splint in exel sheet and directly buildwith VC++ project In-Reply-To: <46B6459B655D7342AB97371E8B7CD8B8F4C7FB@sv-exch.BBR.local> References: <20100507135026.GA25964@svr5.bihl-wiedemann.de> <1C5C9E4F6D407B47B2D87C1DDFE3174D582F8332@GUREXMB01.ASIAN.AD.ARICENT.COM> <46B6459B655D7342AB97371E8B7CD8B8F4C7FB@sv-exch.BBR.local> Message-ID: <1C5C9E4F6D407B47B2D87C1DDFE3174D582F84A0@GUREXMB01.ASIAN.AD.ARICENT.COM> Hi Bodo Wenzel, Thanks for reply. What the output I am just want to take in excel for better readability nothing else. If it possible please let me know. Thanks, Alok -----Original Message----- From: splint-discuss-bounces at cs.virginia.edu [mailto:splint-discuss-bounces at cs.virginia.edu] On Behalf Of Wenzel, Bodo Sent: Tuesday, May 11, 2010 2:48 PM To: Discussions about the Splint annotation-assisted static analysisproject Subject: Re: [splint-discuss] Out put of splint in exel sheet and directly buildwith VC++ project Hi Alok, 1) You can setup the project settings such that additional tools are run. Depending when (custom build, pre-link, post-build) there are several possibilities. Please read the VisualStudio documentation, this is the Splint mailing list, not the VisualStudio mailing list... ;-) 2) What are you trying to achieve with the output in Excel? HTH Bodo Wenzel - Entwicklung Software - -- BBR - Baudis Bergmann R?sch Verkehrstechnik GmbH Pillaustra?e 1e D - 38126 Braunschweig T: +49.531.27300-766 F: +49.531.27300-999 @: wenzel at bbr-vt.de W: http://www.bbr-vt.de Registergericht: AG Braunschweig HRB 3037 Gesch?ftsf?hrer: Dipl.-Ing. Arne Baudis Dipl.-Ing. Thomas Bergmann Dipl.-Ing. Frank-Michael R?sch USt.-ID-Nr.: DE 114 877 881 _______________________________________________ splint-discuss mailing list splint-discuss at mail.cs.virginia.edu http://www.cs.virginia.edu/mailman/listinfo/splint-discuss "DISCLAIMER: This message is proprietary to Aricent and is intended solely for the use of the individual to whom it is addressed. It may contain privileged or confidential information and should not be circulated or used for any purpose other than for what it is intended. If you have received this message in error, please notify the originator immediately. If you are not the intended recipient, you are notified that you are strictly prohibited from using, copying, altering, or disclosing the contents of this message. Aricent accepts no responsibility for loss or damage arising from the use of the information transmitted by this email including damage from virus." From mikereape at onetel.com Thu May 20 15:50:12 2010 From: mikereape at onetel.com (mike) Date: Thu, 20 May 2010 20:50:12 +0100 Subject: [splint-discuss] splint-3.1.2/install/running split on itself Message-ID: <4BF59274.7030905@onetel.com> Hi, I am just getting started with splint. When I did './configure' in the 'splint-3.1.2' dir it produced three errors in 'config.log'. One on: > | #ifndef __cplusplus > | choke me > | #endif and two on tests using 'mode_t' as a declaration in programs doing '#include '. The actual install was fine. 'make check' and 'make install' produced no errors, warnings or failed checks. To get started I thought I'd run splint on itself. If I run this in the 'src' directory: > splint +I.. +IHeaders +IHeaders/../.. +IHeaders/../../.. *.c *.h I get this: > Splint 3.1.2 --- 20 May 2010 > > < loading standard library /usr/local/share/splint/lib/posix.lcd .... > > < preprocessing > > Headers/basic.h:23:28: #error "No config.h file!" > Preprocessing error. (Use -preproc to inhibit warning) > < more preprocessing . In file included from abstract.c:38 > > > Preprocessing error for file: > /home/mike/LLJVM/splint/splint-3.1.2/src/abstract. > c > *** Cannot continue. > < cleaning .......... > Can somebody tell me what is up with the three config errors and what combination of flags and +H includes I should specify to get splint to run all the way through on itself? Thanks very much in advance, Mike From mikereape at onetel.com Thu May 20 17:56:36 2010 From: mikereape at onetel.com (mike) Date: Thu, 20 May 2010 22:56:36 +0100 Subject: [splint-discuss] splint-3.1.2/install/running split on itself In-Reply-To: <4BF59274.7030905@onetel.com> References: <4BF59274.7030905@onetel.com> Message-ID: <4BF5B014.8090106@onetel.com> Further to my previous post it seems that I'm picking up stdio.h from /usr/include (the default search path for includes on my system, Fedora 11) which does not define 'mode_t' but it looks like it's defined in splint-3.1.2/lib/unix.h and splint-3.1.2/lib/posix.h so what do I do? Cheers, Mike On 05/20/2010 08:50 PM, mike wrote: > Hi, > > I am just getting started with splint. When I did './configure' in the > 'splint-3.1.2' dir it produced three errors in 'config.log'. One on: > >> | #ifndef __cplusplus >> | choke me >> | #endif >> > and two on tests using 'mode_t' as a declaration in programs doing > '#include'. > > The actual install was fine. 'make check' and 'make install' produced > no errors, warnings or failed checks. > > To get started I thought I'd run splint on itself. If I run this in the > 'src' directory: > >> splint +I.. +IHeaders +IHeaders/../.. +IHeaders/../../.. *.c *.h >> > I get this: > >> Splint 3.1.2 --- 20 May 2010 >> >> < loading standard library /usr/local/share/splint/lib/posix.lcd ....> >> < preprocessing> >> Headers/basic.h:23:28: #error "No config.h file!" >> Preprocessing error. (Use -preproc to inhibit warning) >> < more preprocessing . In file included from abstract.c:38 >> >>> >> Preprocessing error for file: >> /home/mike/LLJVM/splint/splint-3.1.2/src/abstract. >> c >> *** Cannot continue. >> < cleaning ..........> >> > Can somebody tell me what is up with the three config errors and what > combination of flags and +H includes I should specify to get splint to > run all the way through on itself? > > Thanks very much in advance, > Mike > _______________________________________________ > splint-discuss mailing list > splint-discuss at mail.cs.virginia.edu > http://www.cs.virginia.edu/mailman/listinfo/splint-discuss > > From waltergoossens at home.nl Thu May 20 18:12:43 2010 From: waltergoossens at home.nl (Walter Goossens) Date: Fri, 21 May 2010 00:12:43 +0200 Subject: [splint-discuss] splint-3.1.2/install/running split on itself In-Reply-To: <4BF5B014.8090106@onetel.com> References: <4BF59274.7030905@onetel.com> <4BF5B014.8090106@onetel.com> Message-ID: <4BF5B3DB.3040709@home.nl> Have you tried running with +posixlib or +unixlib? On 5/20/10 11:56 PM, mike wrote: > Further to my previous post it seems that I'm picking up stdio.h from > /usr/include (the default search path for includes on my system, Fedora > 11) which does not define 'mode_t' but it looks like it's defined in > splint-3.1.2/lib/unix.h and splint-3.1.2/lib/posix.h so what do I do? > > Cheers, > Mike > > On 05/20/2010 08:50 PM, mike wrote: > >> Hi, >> >> I am just getting started with splint. When I did './configure' in the >> 'splint-3.1.2' dir it produced three errors in 'config.log'. One on: >> >> >>> | #ifndef __cplusplus >>> | choke me >>> | #endif >>> >>> >> and two on tests using 'mode_t' as a declaration in programs doing >> '#include'. >> >> The actual install was fine. 'make check' and 'make install' produced >> no errors, warnings or failed checks. >> >> To get started I thought I'd run splint on itself. If I run this in the >> 'src' directory: >> >> >>> splint +I.. +IHeaders +IHeaders/../.. +IHeaders/../../.. *.c *.h >>> >>> >> I get this: >> >> >>> Splint 3.1.2 --- 20 May 2010 >>> >>> < loading standard library /usr/local/share/splint/lib/posix.lcd ....> >>> < preprocessing> >>> Headers/basic.h:23:28: #error "No config.h file!" >>> Preprocessing error. (Use -preproc to inhibit warning) >>> < more preprocessing . In file included from abstract.c:38 >>> >>> >>>> >>>> >>> Preprocessing error for file: >>> /home/mike/LLJVM/splint/splint-3.1.2/src/abstract. >>> c >>> *** Cannot continue. >>> < cleaning ..........> >>> >>> >> Can somebody tell me what is up with the three config errors and what >> combination of flags and +H includes I should specify to get splint to >> run all the way through on itself? >> >> Thanks very much in advance, >> Mike >> _______________________________________________ >> splint-discuss mailing list >> splint-discuss at mail.cs.virginia.edu >> http://www.cs.virginia.edu/mailman/listinfo/splint-discuss >> >> >> > _______________________________________________ > splint-discuss mailing list > splint-discuss at mail.cs.virginia.edu > http://www.cs.virginia.edu/mailman/listinfo/splint-discuss > > From mikereape at onetel.com Thu May 20 19:16:56 2010 From: mikereape at onetel.com (mike) Date: Fri, 21 May 2010 00:16:56 +0100 Subject: [splint-discuss] splint-3.1.2/install/running split on itself In-Reply-To: <4BF5B3DB.3040709@home.nl> References: <4BF59274.7030905@onetel.com> <4BF5B014.8090106@onetel.com> <4BF5B3DB.3040709@home.nl> Message-ID: <4BF5C2E8.1020505@onetel.com> Hi I didn't make myself clear. It's the splint configure itself that gets the errors not a use of splint to analyse another system. The question is will splint configure itself if I specify to 'configure' that it should look for includes in 'splint-3.1.2/lib'? I'll try that anyway but I won't get to it till tomorrow. Thanks for the reply. Cheers, Mike On 05/20/2010 11:12 PM, Walter Goossens wrote: > Have you tried running with +posixlib or +unixlib? > > On 5/20/10 11:56 PM, mike wrote: > >> Further to my previous post it seems that I'm picking up stdio.h from >> /usr/include (the default search path for includes on my system, Fedora >> 11) which does not define 'mode_t' but it looks like it's defined in >> splint-3.1.2/lib/unix.h and splint-3.1.2/lib/posix.h so what do I do? >> >> Cheers, >> Mike >> >> On 05/20/2010 08:50 PM, mike wrote: >> >> >>> Hi, >>> >>> I am just getting started with splint. When I did './configure' in the >>> 'splint-3.1.2' dir it produced three errors in 'config.log'. One on: >>> >>> >>> >>>> | #ifndef __cplusplus >>>> | choke me >>>> | #endif >>>> >>>> >>>> >>> and two on tests using 'mode_t' as a declaration in programs doing >>> '#include'. >>> >>> The actual install was fine. 'make check' and 'make install' produced >>> no errors, warnings or failed checks. >>> >>> To get started I thought I'd run splint on itself. If I run this in the >>> 'src' directory: >>> >>> >>> >>>> splint +I.. +IHeaders +IHeaders/../.. +IHeaders/../../.. *.c *.h >>>> >>>> >>>> >>> I get this: >>> >>> >>> >>>> Splint 3.1.2 --- 20 May 2010 >>>> >>>> < loading standard library /usr/local/share/splint/lib/posix.lcd ....> >>>> < preprocessing> >>>> Headers/basic.h:23:28: #error "No config.h file!" >>>> Preprocessing error. (Use -preproc to inhibit warning) >>>> < more preprocessing . In file included from abstract.c:38 >>>> >>>> >>>> >>>>> >>>>> >>>> Preprocessing error for file: >>>> /home/mike/LLJVM/splint/splint-3.1.2/src/abstract. >>>> c >>>> *** Cannot continue. >>>> < cleaning ..........> >>>> >>>> >>>> >>> Can somebody tell me what is up with the three config errors and what >>> combination of flags and +H includes I should specify to get splint to >>> run all the way through on itself? >>> >>> Thanks very much in advance, >>> Mike >>> _______________________________________________ >>> splint-discuss mailing list >>> splint-discuss at mail.cs.virginia.edu >>> http://www.cs.virginia.edu/mailman/listinfo/splint-discuss >>> >>> >>> >>> >> _______________________________________________ >> splint-discuss mailing list >> splint-discuss at mail.cs.virginia.edu >> http://www.cs.virginia.edu/mailman/listinfo/splint-discuss >> >> >> > _______________________________________________ > 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/20100521/e3a9858a/attachment.html From splint at sympatico.ca Fri May 21 00:36:15 2010 From: splint at sympatico.ca (Bill Pringlemeir) Date: Fri, 21 May 2010 00:36:15 -0400 Subject: [splint-discuss] splint-3.1.2/install/running split on itself In-Reply-To: <4BF59274.7030905@onetel.com> (mike's message of "Thu, 20 May 2010 20:50:12 +0100") References: <4BF59274.7030905@onetel.com> Message-ID: On 20 May 2010, mikereape at onetel.com wrote: > I am just getting started with splint. When I did './configure' in the > 'splint-3.1.2' dir it produced three errors in 'config.log'. One on: >> | #ifndef __cplusplus >> | choke me >> | #endif > and two on tests using 'mode_t' as a declaration in programs doing > '#include '. > The actual install was fine. 'make check' and 'make install' produced > no errors, warnings or failed checks. If 'make check' did not produce any errors, I think you have built it properly. Looking through the config.log is a little paranoid. System headers often have 'magic' in them that is not ANSI 'C' or at least it is difficult for splint (or any source analyzer) to understand every system file on the planet. Hence you can have libraries with annotation in splint. > To get started I thought I'd run splint on itself. Try 'make lintnew' or one of the others. > Can somebody tell me what is up with the three config errors ... You didn't post the full output. Why do you think they are errors? Splint might try to use a system file and if it is not parsable substitute something else (some other annotated header, etc) and you might not get all of the symbols in your system headers [which shouldn't matter depending on your perspective]. > and what combination of flags and +H includes I should specify to > get splint to run all the way through on itself? Error! Redundant text. Aborting!!! -- Yow! Legally-imposed CULTURE-reduction is CABBAGE-BRAINED! From splint at sympatico.ca Fri May 21 00:36:15 2010 From: splint at sympatico.ca (Bill Pringlemeir) Date: Fri, 21 May 2010 00:36:15 -0400 Subject: [splint-discuss] splint-3.1.2/install/running split on itself In-Reply-To: <4BF59274.7030905@onetel.com> (mike's message of "Thu, 20 May 2010 20:50:12 +0100") References: <4BF59274.7030905@onetel.com> Message-ID: On 20 May 2010, mikereape at onetel.com wrote: > I am just getting started with splint. When I did './configure' in the > 'splint-3.1.2' dir it produced three errors in 'config.log'. One on: >> | #ifndef __cplusplus >> | choke me >> | #endif > and two on tests using 'mode_t' as a declaration in programs doing > '#include '. > The actual install was fine. 'make check' and 'make install' produced > no errors, warnings or failed checks. If 'make check' did not produce any errors, I think you have built it properly. Looking through the config.log is a little paranoid. System headers often have 'magic' in them that is not ANSI 'C' or at least it is difficult for splint (or any source analyzer) to understand every system file on the planet. Hence you can have libraries with annotation in splint. > To get started I thought I'd run splint on itself. Try 'make lintnew' or one of the others. > Can somebody tell me what is up with the three config errors ... You didn't post the full output. Why do you think they are errors? Splint might try to use a system file and if it is not parsable substitute something else (some other annotated header, etc) and you might not get all of the symbols in your system headers [which shouldn't matter depending on your perspective]. > and what combination of flags and +H includes I should specify to > get splint to run all the way through on itself? Error! Redundant text. Aborting!!! -- Yow! Legally-imposed CULTURE-reduction is CABBAGE-BRAINED! From ok at cs.otago.ac.nz Fri May 21 02:21:29 2010 From: ok at cs.otago.ac.nz (Richard O'Keefe) Date: Fri, 21 May 2010 18:21:29 +1200 Subject: [splint-discuss] splint-3.1.2/install/running split on itself In-Reply-To: <4BF5B014.8090106@onetel.com> References: <4BF59274.7030905@onetel.com> <4BF5B014.8090106@onetel.com> Message-ID: <39A872FD-2E80-4170-B1D1-E63F443D57A1@cs.otago.ac.nz> On May 21, 2010, at 9:56 AM, mike wrote: > Further to my previous post it seems that I'm picking up stdio.h from > /usr/include (the default search path for includes on my system, > Fedora > 11) which does not define 'mode_t' but it looks like it's defined in > splint-3.1.2/lib/unix.h and splint-3.1.2/lib/posix.h so what do I do? mode_t is supposed to come from I keep the Single Unix Specification version 3 and also version 4 handy, and I would never *expect* mode_t to be found in . (I also wouldn't be surprised at almost anything turning up anywhere... If you #include the right header and tell splint +posixlib, it should work. > > From ok at cs.otago.ac.nz Fri May 21 02:21:29 2010 From: ok at cs.otago.ac.nz (Richard O'Keefe) Date: Fri, 21 May 2010 18:21:29 +1200 Subject: [splint-discuss] splint-3.1.2/install/running split on itself In-Reply-To: <4BF5B014.8090106@onetel.com> References: <4BF59274.7030905@onetel.com> <4BF5B014.8090106@onetel.com> Message-ID: <39A872FD-2E80-4170-B1D1-E63F443D57A1@cs.otago.ac.nz> On May 21, 2010, at 9:56 AM, mike wrote: > Further to my previous post it seems that I'm picking up stdio.h from > /usr/include (the default search path for includes on my system, > Fedora > 11) which does not define 'mode_t' but it looks like it's defined in > splint-3.1.2/lib/unix.h and splint-3.1.2/lib/posix.h so what do I do? mode_t is supposed to come from I keep the Single Unix Specification version 3 and also version 4 handy, and I would never *expect* mode_t to be found in . (I also wouldn't be surprised at almost anything turning up anywhere... If you #include the right header and tell splint +posixlib, it should work. > > From newlifewithg at gmail.com Thu May 27 06:14:38 2010 From: newlifewithg at gmail.com (A Z) Date: Thu, 27 May 2010 19:14:38 +0900 Subject: [splint-discuss] Annotations in Memory Management:only, owned , dependent, refcounted Message-ID: Guys I am reading Splint Manual for Memory Management Bugs and not getting any clue on following Annotations: 1:only 2:owned 3:dependent 4:refcounted The problem I am facing with the examples within the manual.It is hard to understand.So it will be helpful if you guys provide me easy to understand examples. Thanks,Ajay From splint at sympatico.ca Thu May 27 17:42:14 2010 From: splint at sympatico.ca (Bill Pringlemeir) Date: Thu, 27 May 2010 17:42:14 -0400 Subject: [splint-discuss] Annotations in Memory Management:only, owned , dependent, refcounted In-Reply-To: (A. Z.'s message of "Thu, 27 May 2010 19:14:38 +0900") References: Message-ID: On 27 May 2010, newlifewithg at gmail.com wrote: > I am reading Splint Manual for Memory Management Bugs and not getting > any clue on following Annotations: > 1:only > 2:owned > 3:dependent > 4:refcounted > The problem I am facing with the examples within the manual.It is hard > to understand.So it will be helpful if you guys provide me easy to > understand examples. > Thanks,Ajay The manual assumes familiarity with several design patterns. See this link, http://www.informit.com/articles/article.aspx?p=30309 The 'only' annotation is for pool and fixed sized patterns. This includes the typical 'C' malloc/free. The 'refcounted' can be used to implement a pseudo-garbage collection in 'C'. Reference counting is also a method to implement smart pointers. C++ will do this with very little developer interaction (and code will be silently generated), where as developers have to do some of this manual in 'C'. Dependent and owned are not outlined as a design pattern above. The are useful in an object-orient allocation strategy in 'C'. That is some principal structure is the object (owns it) and something else is only using it (dependent on the owner having created it). Generally unless you are very sophisticated (and a masochist), you will only need the 'only' annotation. The owned/dependent might be useful if you are using object-oriented principals in 'C'. In 'C' you have to manually increment/decrement a reference count. However, there can be several users of the same 'object' (structure, array, etc). This can be useful if there is no concrete owner of an object, but several different things might make use of it. Refcounted is like a 'multiple owner'. The more complex schemes are difficult to get right in a multi-threaded environment and *probably* aren't as useful if you don't have threads. hth, Bill Pringlemeir. -- Yow! Legally-imposed CULTURE-reduction is CABBAGE-BRAINED! From newlifewithg at gmail.com Mon May 31 01:12:50 2010 From: newlifewithg at gmail.com (A Z) Date: Mon, 31 May 2010 14:12:50 +0900 Subject: [splint-discuss] Annotations in Memory Management:only, owned , dependent, refcounted Message-ID: Bill Thanks. I will analyze the topic:"Real-Time Design Patterns: Memory Patterns" of the book and try to map the understandings to the manual. Best,Ajay On Sat, May 29, 2010 at 4:00 AM, wrote: > Send splint-discuss mailing list submissions to > ? ? ? ?splint-discuss at mail.cs.virginia.edu > > To subscribe or unsubscribe via the World Wide Web, visit > ? ? ? ?http://www.cs.virginia.edu/mailman/listinfo/splint-discuss > or, via email, send a message with subject or body 'help' to > ? ? ? ?splint-discuss-request at mail.cs.virginia.edu > > You can reach the person managing the list at > ? ? ? ?splint-discuss-owner at mail.cs.virginia.edu > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of splint-discuss digest..." > > > Today's Topics: > > ? 1. Re: Annotations in Memory Management:only, owned , ? ? ? ?dependent, > ? ? ?refcounted (Bill Pringlemeir) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Thu, 27 May 2010 17:42:14 -0400 > From: Bill Pringlemeir > Subject: Re: [splint-discuss] Annotations in Memory Management:only, > ? ? ? ?owned , dependent, refcounted > To: splint-discuss at cs.virginia.edu > Message-ID: > Content-Type: text/plain; charset=us-ascii > > On 27 May 2010, newlifewithg at gmail.com wrote: > >> I am reading Splint Manual for Memory Management Bugs and not getting >> any clue on following Annotations: >> 1:only >> 2:owned >> 3:dependent >> 4:refcounted > >> The problem I am facing with the examples within the manual.It is hard >> to understand.So it will be helpful if you guys provide me easy to >> understand examples. >> Thanks,Ajay > > The manual assumes familiarity with several design patterns. ?See this link, > > ?http://www.informit.com/articles/article.aspx?p=30309 > > The 'only' annotation is for pool and fixed sized patterns. ?This > includes the typical 'C' malloc/free. > > The 'refcounted' can be used to implement a pseudo-garbage collection > in 'C'. ?Reference counting is also a method to implement smart > pointers. ?C++ will do this with very little developer interaction > (and code will be silently generated), where as developers have to do > some of this manual in 'C'. > > Dependent and owned are not outlined as a design pattern above. ?The > are useful in an object-orient allocation strategy in 'C'. ?That is > some principal structure is the object (owns it) and something else is > only using it (dependent on the owner having created it). > > Generally unless you are very sophisticated (and a masochist), you > will only need the 'only' annotation. ?The owned/dependent might be > useful if you are using object-oriented principals in 'C'. ?In 'C' you > have to manually increment/decrement a reference count. ?However, > there can be several users of the same 'object' (structure, array, > etc). ?This can be useful if there is no concrete owner of an object, > but several different things might make use of it. ?Refcounted is like > a 'multiple owner'. ?The more complex schemes are difficult to get > right in a multi-threaded environment and *probably* aren't as useful > if you don't have threads. > > hth, > Bill Pringlemeir. > > -- > Yow! ?Legally-imposed CULTURE-reduction is CABBAGE-BRAINED! > > > ------------------------------ > > _______________________________________________ > splint-discuss mailing list > splint-discuss at mail.cs.virginia.edu > http://www.cs.virginia.edu/mailman/listinfo/splint-discuss > > > End of splint-discuss Digest, Vol 66, Issue 6 > ********************************************* >