Mike Sullivan wrote: > Dermot McCluskey wrote: > >> I'd also prefer those new options to be in Makefile.master as > >> well - perhaps as new individual variables, so they can be > >> easily adjusted if they change on compiler updates without having > >> to update every Makefile in the gate. There could also be a > >> variable that combines them all if you like, though I can't > >> think of any other name right now than > >> ROLANDS_KSH_OPTIONS :) > > > > xc99 was already in Makefile.master. I've added the other options as: > > # XPG6 > > XPG6MODE= -D_XOPEN_SOURCE=600 > > XPG6MODE_EXT= $(XPG6MODE) -D__EXTENSIONS__=1 > > > > If you don't like the names I've chosen, please suggest better ones. > > Nah they're fine. Assuming the comment is enough to explain them, > though why you might want them would be cool.
AFAIK the "why you want them" was explained earlier in this thread. Many OpenSource projects assume newer APIs than the Solaris defaults and then fall-back to "homegrown" workaround if they do not get the expected behaviour defined in the POSIX/SUS/etc. standards (or what they think what the standard may say. Popular example is the shell used by libc functions like |popen()| and |system()| - the default in Solaris is /usr/bin/sh while XPG4+XPG6 modes use /usr/xpg4/bin/sh which is much closer to what OpenSource projects expect from a "default shell". Another good example is the |libc::printf()| function where C99/XPG6 behaviour is more and more expected from applications) ... and then they complain loudly about "Solaris being obsolete etc." - which then leads to ideas like "...rip Solaris libc out and replace it with glibc etc. ..." or worse. Or short (list-style): * Problem: - Portable OpenSource projects expect standard behaviour for libc&co. functions. If they do not get the expected behavour they either use "homegrown" code, disable some functionality or require maintaining a port on our side - Solaris libc defaults to traditional Unix behaviour - Solaris libc supports XPG4+XPG6 by setting the matching compiler flags but this information is almost unknown outside Sun. And trying to educate each single opensource project out there is a fight against windmills. * Proposed solutions: 1. Make the "XPG6MODE= $(C99MODE) -D_XOPEN_SOURCE=600 -D__EXTENSIONS__=1"-flags the _default_ for all SFWNV projects unless there is a good reason why it cannot be done 2. Ask the compiler folks to switch to C99/XPG6 mode by default ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) roland.mainz at nrubsig.org \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 7950090 (;O/ \/ \O;)
