Date: Mon, 16 Jul 2001 10:35:22 -0400 (EDT) From: Mike Barcroft <mike@q9media.com> To: David Malone <dwmalone@maths.tcd.ie> Cc: audit@FreeBSD.org Subject: Re: inetd(8) warns patch Message-ID: <200107161435.f6GEZM631927@coffee.q9media.com>
next in thread | raw e-mail | index | archive | help
David Malone <dwmalone@maths.tcd.ie> writes: > > I would appreciate your comments on the patch at the end of this > > message. I'm not entirely sure about removing the legacy setproctitle > > stuff. If you'd like to keep it in there, the prototype for main() > > will need two versions. One for the legacy setproctitle and one > > for normal use. > > Looks fine to me, as long as __unused is considered acceptable in > our code. (I know you can get rid of the __unused for compilers > that don't understand it by using a #define, but if another compiler > denotes unused variables/parameters by "unused int blah;" then > you can't generate this statement.) __unused is the preferred way to mark unused variables. It's our wrapper for gcc's __attribute__((__unused__)). See <sys/cdefs.h> for details. > Would you like me to commit it? Yes, thanks. > (I'm also slightly suprised that the WARNS flags don't whine about > the nasty SWAP marco which contains a gccism.) gcc doesn't really care about gccisms unless -ansi and -pedantic are specified. That macro could probably be made portable using a third argument and a union. > BTW - I was looking at doing WARNS stuff for syslogd and it doesn't > seem to be very easy 'cos syslogd uses writev(2) and iov_base > pointers are of type "char *" not "const char *". I'm not subscribed > to -audit so I don't know if anyone has a suggested workaround for > these situations. Gererally speaking, it's usually a good idea to fix the root problem. If writev(2) and friends don't need to write to that variable, it's questionable why it's a char *. Some things just don't work with WARNS, such as RPC, because of library evilness. Best regards, Mike Barcroft To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200107161435.f6GEZM631927>