RE: [Cppunit-devel] config.h changes committed
Brought to you by:
blep
From: Bastiaan B. <bas...@li...> - 2001-06-18 07:03:10
|
> -----Oorspronkelijk bericht----- > Van: Steve M. Robbins [mailto:ste...@vi...] > Verzonden: Monday, June 18, 2001 4:29 AM > Aan: cpp...@li... > Onderwerp: Re: [Cppunit-devel] config.h changes committed > > > On Mon, Jun 18, 2001 at 01:17:03AM +0200, Bastiaan Bakker wrote: > > "Steve M. Robbins" wrote: > > > > > On Sun, Jun 17, 2001 at 10:20:16PM +0200, Bastiaan Bakker wrote: > > > > > * use autoconf 2.40 or higher to rebuild aclocal.m4, > because the > > > > AC_CREATE_PREFIX_CONFIG_H macro needs the AS_DIRNAME macro. > > > > > > I expect you meant "2.50" ? > > > > The docs somewhere stated that AS_DIRNAME has been included in 2.40. > > Don't know whether that's a public release or not, or that it was a > > typo. I'm using 2.50 myself. > > Interesting. There was no public 2.40, certainly. In fact, there is > no mention of 2.40 anywhere in the autoconf NEWS or ChangeLog files > that I can find. > Now that I think of it, 2.40 very likely was mentioned in the docs to the > > > > > * include <cppunit/Portability.h> instead of <cppunit/config.h> > > Looks good. > > About Portability.h, I have three questions. > > > 1. Shouldn't this bit go into config-msvc6.h? > > #if _MSC_VER > 1000 // VC++ > #pragma once > #pragma ... > > > 2. Which way should the "naked assert" default? I thought the > consensus was to NOT define assert() by default. However, > Portability.h enables them by default. More importantly, the header > introduces an extra symbol, which I think is unnecessary. We could > write it as > > #ifndef CPPUNIT_ENABLE_NAKED_ASSERT > #define CPPUNIT_ENABLE_NAKED_ASSERT 0[*] > #endif > > [*] or 1, depending on the default desired. > > > > 3. Is it useful to have CPPUNIT_USE_TYPEINFO as well as > CPPUNIT_HAVE_RTTI? Certainly you can't define the former without the > latter. Would you ever WANT to disable using RTTI, if available? If > not, then we can eliminate USE_TYPEINFO in favour of HAVE_RTTI. If > disabling it _is_ deemed useful, then the same comment about the extra > symbol applies; the stanza can be simplified to > > #ifndef CPPUNIT_USE_TYPEINFO > #define CPPUNIT_USE_TYPEINFO 1 > #endif > > Ad. 1) My idea for config-msv6.h, etc. is that they are but replacements for config-auto.h: they just set some preprocessor switches and don't do anything else. This way it's simple to verify whether they are still complete with respect to config-auto.h. Portability.h then should contain all workarounds and hacks necessary, based on the switches in config-*.h In short: the _MSC_VER in Portability.h was intentional. Ad. 2, 3) The code fragments for CPPUNIT_USE_NAKED_ASSERT and CPPUNIT_USE_TYPEINFO were copied verbatim from include/cppunit/config.h.in, so their settings are not new and do not express my opinion on how they should be. Ad. 2) I agree, the naked assert should be off by default. Ad. 3) The fact that the compiler can do RTTI doesn't always mean you want to have it, for example when you have very tight environment, or the implementation is broken, etc. Anyway it seems useless to have multiple symbols: a --disable-rtti switch in autoconf could disable RTTI on the compiler and unset HAVE_RTTI. Bastiaan |