On Mon, Jul 21, 2008 at 7:44 PM, Garrett D'Amore <[EMAIL PROTECTED]> wrote: > Cyril Plisko wrote: >> >> Hi ! >> >> What is the policy (if any) on using C++ reserved words (keywords) in >> header files, that shipped in /usr/include ? >> >> > > I don't know if there is any official policy, but IMO: > > 1) Use of C++ reserved words in *public* headers that are to be consumed by > userland applications should be verboten
Agree 100%. And by *public* I understand all those shipped in /usr/include. > 2) Correct use of C++ reserved words (in code intended to be compiled as > C++) protected by #ifdef __cplusplus seems OK to me. > > > 3) Incorrect use of C++ reserved words in kernel-private headers (e.g. > #ifdef __KERNEL protected) seems like a bad idea, but possibly acceptable. > (Note however that sometimes C++ code might be compiled into objects which > get included in device drivers, and so even this case might not be a wise > idea.) Right. So, should I file a bug if I find a case of "unprotected" C++ keyword in system headers ? I have a real case here with customer' C++ application that happens to be related to SCSI. They are evaluating support for Solaris Express/OpenSolaris. The offending header file is /usr/include/sys/scsi/targets/stdef.h [1]. The structure member "explicit" breaks compilation with C++. Apparently this is newish code, that was added in rev 5628 [2], so they never saw this with Solaris 10. So does this warrants filing a bug against stdef.h ? [1] http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/sys/scsi/targets/stdef.h#845 [2] http://src.opensolaris.org/source/diff/onnv/onnv-gate/usr/src/uts/common/sys/scsi/targets/stdef.h?r2=%2Fonnv%2Fonnv-gate%2Fusr%2Fsrc%2Futs%2Fcommon%2Fsys%2Fscsi%2Ftargets%2Fstdef.h%405628&r1=%2Fonnv%2Fonnv-gate%2Fusr%2Fsrc%2Futs%2Fcommon%2Fsys%2Fscsi%2Ftargets%2Fstdef.h%405425 -- Regards, Cyril _______________________________________________ opensolaris-code mailing list opensolaris-code@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/opensolaris-code