ignored return values

andreas moroder claudiamoroder at st-ulrich.suedtirol.net
Sun Jan 20 02:15:01 GMT 2002


Hello Simon,

I send you a lists of the ignored return values in server.c you asked for.

smbd/server.c:122:4: Return value (type int) ignored: atexit(killkids)
smbd/server.c:165:5: Return value (type int) ignored: close(s)  **
smbd/server.c:188:4: Return value (type int) ignored: close(s) **
smbd/server.c:267:6: Return value (type int) ignored: close(fd_listens...     
smbd/server.c:283:5: Return value (type int) ignored: tdb_reopen_all()
smbd/server.c:288:4: Return value (type int) ignored: close(smbd_serve...
smbd/server.c:404:2: Return value (type int) ignored: mkdir(dname, 0700)
smbd/server.c:405:2: Return value (type int) ignored: sys_chown(dname,...
smbd/server.c:406:2: Return value (type int) ignored: chmod(dname, 0700)
smbd/server.c:414:3: Return value (type int) ignored: getrlimit(RLIMIT...
smbd/server.c:416:3: Return value (type int) ignored: setrlimit(RLIMIT...
smbd/server.c:417:3: Return value (type int) ignored: getrlimit(RLIMIT...
smbd/server.c:441:3: Return value (type int) ignored: tdb_change_int32...
smbd/server.c:758:3: Return value (type int) ignored: setpgid((pid_t)0...
smbd/server.c:762:3: Return value (type int) ignored: mkdir(lp_lockdir...

There is also the following warning that may be checked

smbd/server.c:564:15: Variable optarg shadows outer declaration
  An outer declaration is shadowed by the local declaration. (Use -shadow to
  inhibit warning)
   /usr/include/getopt.h:47:14: Previous declaration of optarg: char *

** No comment ;-)

Remember, this was only warnings in server.c. 

IMHO all the main developers should use this tool. Yes, in this case it would 
be necessary to add informations to the source that helps splint, but many 
errors could be avoided.

Remember, that splint works only if include.h is changed the way, that syslog 
is only included if really necessary ( never in my case )

Bye

Andreas




More information about the samba-technical mailing list