Boost logo

Boost :

From: Giovanni Bajo (giovannibajo_at_[hidden])
Date: 2002-04-01 12:36:58

> I don't have access to Comeau C++ so I can't test how it behaves in its
> various modes. I assumed that when _MSC_VER is defined, then the compiler
> in MSVC compatibility mode.

No, it means that it is using MSVC as the C backend, which is orthogonal to
the language understood by the compiler.

> Are you saying that in strict mode _MSC_VER is
> still defined, but the void returns work? If so, can you post a patch to
> boost/config/compiler/comeau.hpp?

The problem is that "strict mode" is just a collection of switches. You
could still lie, go to microsoft mode and activate void returns, so the fix
would not work.

> Also, did you try to run Comeau in MSVC 7 mode? I'm fairly certain that
> returns work. The option was --microsoft-ver=1300 IIRC but I may be wrong.

I am not sure under which conditons I should try it, since the code already
works in default microsoft compatibility mode.
Let me resume the situation:

- The normal code (with void returns) works in strict mode, but fails in
microsoft compatibility mode (since they emulate this 'bug' of MSVC).
- The void workaround code does not compile in strict mode but it does
compile correctly in microsoft mode. This appears to be a bug in the
compiler, I've already reported them to the support and they will look into

There are two solutions I can think of (once the bug has been fixed):

1) Always use the return void workaround with Comeau. Or
2) Use a very specific preprocessor flag to detect if void returns are

> (The void returns path is problematic in general. It works on MSVC 6 and
> EDG 2.38 (?) but few other compilers can cope.)

Deriving a template from a dependent nested template of a dependent template
is something that may cause some problems, yes :)

Giovanni Bajo

Boost list run by bdawes at, gregod at, cpdaniel at, john at