Ceri Davies wrote: > On Fri, May 08, 2009 at 07:22:33PM +0200, Roland Mainz wrote: > > John Beck wrote: [snip] > > ... some nits: > > * a -xstrconst in the CFLAGS would be nice (footprint reduction). > > > > * IMO it would be nice to compile this application with C99/XPG6 flags > > (footprint reduction/performance) > > I don't really understand the implications of either of these two > suggestions, so I'm happy to do whatever common practice is.
The implications are that the system (e.g. libc) behaves more POSIX/SUS-conformant than the plain Solaris defaults, e.g. if you use "-xc99=%all -D_XOPEN_SOURCE=600 -D__EXTENSIONS__=1" (see http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/Makefile.ast#30 or http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/cmd-inet/usr.lib/in.mpathd/Makefile#45 how to use it in OS/Net) the compiler+libc behaviour more closely behaves like modern Linux+BSD platforms. [snip] > > * usr/src/cmd/mailwrapper/mailwrapper.c > > - Line 57: int main(int, char *[], char *[]); > > Why is this prototype required ? > > As John suggested, this was pulled from upstream and I didn't make any > changes that weren't required to make the application compile and work. OK... > > - What about better messages for |malloc| failure handling, e.g. lines: > > 68 err(EX_TEMPFAIL, "malloc"); > > 84 err(EX_TEMPFAIL, "strdup"); > > etc. > > AFAIK at least the function name in these message _may_ be helpfull. > > I agree with what you're saying regarding these messages but this is an > upstream issue too. > > Of course, I am still (at least on paper) a committer to the FreeBSD > Project so it's possible that I can fix these in the upstream code. > That will require me to justify making changes in code that is also shared > by NetBSD (and OpenBSD maybe, I don't actually know) so might take a > while and therefore I'd prefer to not make the changes for OpenSolaris > without making them upstream first (or at the same time at least). Ok... > > - It may be nice to use |strtok_r()| instead of |strtok()| (performance > > (|strtok()| uses |tsdalloc()| and then calls |strtok_r()|)) > > The strtok() calls are mine (FreeBSD uses its strsep() in the original > code) so I'm happy to make that replacement. Thanks! :-) ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) roland.ma...@nrubsig.org \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 3992797 (;O/ \/ \O;) _______________________________________________ opensolaris-code mailing list opensolaris-code@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/opensolaris-code