Hi Roland,

I have 2 questions.

> > 
> > $ ../../../bin/splint +posixlib -posix-lib -I/usr/include/glib-2.0 
> > -I/usr/include/gtk-2.0 -I../plugins/ -I/usr/include/pango-1.0/ 
> > -I/usr/include/wine/wine  *.c
> > Splint 3.1.1 --- 26 Sep 2003
> > 
> > /usr/include/arpa/inet.h:35:27: Parse Error. (For help on parse errors, see
> >                splint -help parseerrors.)
> > *** Cannot continue.
> 
> I know that error.
> 
> The offending line (Linux 2.4.21, Debian) is:
> typedef __socklen_t socklen_t;
> 
> Splint does not recognize <arpa/inet.h> as a system header, but knows
> <netinet/in.h>.
> 
> The type __socklen_t is defined in <netinet/in.h>. Splint does not parse
> this header and uses its own definitions instead. Therefore the
> identifier __socklen_t is not known to splint.
> 
> Solution 1: Splint should have an additional library (like posixlib)
> that knows the Single Unix Specification (susv3).


How do I include posixlib with Splint ? At present I am using two command 
line options: 
1) +posixlib (as told in http://splint.org/manual/manual.html )
2) -posix-lib ( given in man page for splint)
I do not understand difference between the two options :(

> 
> Solution 2: Write your own splint-specific header <arpa/inet.h>.
> 
> #ifdef S_SPLINT_S
> # include "splint-include/arpa/inet.h"
> #else
> # include <arpa/inet.h>
> #endif
> 
> ==== splint-include/arpa/inet.h ====
> typedef /[EMAIL PROTECTED]@*/ socklen_t;
> 
> /* ... other definitions ... */
> ==== EOF ====
> 

This seemed to work but I just want to make sure I am doing it the right way.
I have put #ifdef .. #endif statements in test code that uses inet.h
and created a replica of inet.h in splint-include folder and added the line
typedef /[EMAIL PROTECTED]@*/ socklen_t;

Thanks,

nayan
-- 
______________________________________
Get your free email from www.bolt.com!

Powered by Outblaze
_______________________________________________
splint-discuss mailing list
[EMAIL PROTECTED]
http://www.splint.org/mailman/listinfo/splint-discuss

Reply via email to