Re: Code guidelines, state of C++ compilers used, and general C++comments


Subject: Re: Code guidelines, state of C++ compilers used, and general C++comments
From: Mike Nordell (tamlin@algonet.se)
Date: Tue May 09 2000 - 02:14:16 CDT


sam th wrote:

> On Tue, 9 May 2000, Mike Nordell wrote:
>
> > 4. Add: If you do use C++, prefer C++ style comments (//).
>
> Well, except for large comment blocks.
True. There are also places where old C-style comment are neccessary:
void foo(bar* pBar /* [out] */);

> Also, we might want to put something in about the use of
> #if 0
>
> #endif
>
> for debugging/code-switching purposes (there was some discussion about
> this a while back).

It might be useful to leave some of these blocks for future reference
like

#if 0
// non-working, slow, alghorithm explaining or
// displaying a bug# fix
#else
// working, optimized or whatever
#endif

or

#if 0
// support for this feature will be added Real Soon Now :-)
#endif

but as a rule of thumb I'd like to see as little as possible of this in
committed code.

> > 7. "Don't put platform specifics in XP code".
[snip]
>
> #pragma is used in 3 places
>
> af/ev/beos/ev_BeOSToolbar.cpp - not sure of the use
> af/util/xp/ut_regex.c - for AIX compatibility
> af/xap/unix/xap_UnixPSParseAFM.c - for Win32 warning, as you say
>
> the only one not hidden in ifdef's is the BeOS one.

The point was that the coding guidelines explicitly denies usage of
platform specific #ifdefs in xp files. Maybe that should be loosened a
little as to allow this kind of... Wait a minute. What has a Win32/MSC
pragma to do in a unix specific file?! :-)
Please foreget the "loosen it a bit". It should rather be enforced with
iron fist. :-)

> > Q: Is anyone using/aware of any compiler that we support that have
int's
> > of less than 32 bits?
>
> Compilers we use -
>
> MSVC 6 and up
> gcc/g++ probably 2.7.8.2 and up
> borland cc i dont know the version
> Metroworks unkown version

Afaik all of these:
1. Have 'bool'.
2. Have at least 32-bit ints.
3. Supports basic class template usage.

> > I think it would be of use to have a a webpage at the site that
states
> > what compilers are used, what operating systems they're used on, and
what
> > C++ "features" (i.e. required ISO standard behaviour) we could
benefit
> > from using that they don't support.
>
> An excellent idea. I don't know if there are ways to find out the
> compatibility and conformance levels, but it sure would be nice to
have.

I think I've seen a webpage about it. If not, I could easily create a
_small_ "conformance test kit".

/Mike - please only post follow-ups to the list



This archive was generated by hypermail 2b25 : Tue May 09 2000 - 01:14:30 CDT