[mps-discussion] Building on Visual Studio 7

Pekka P. Pirinen Pekka.P.Pirinen at globalgraphics.com
Wed Mar 2 17:50:13 GMT 2005


Thanks for the detailed notes.

Bruce Mitchener writes:
>    c:\dev\mps\code\testlib.c(100) : warning C4702: unreachable code

This seems to be complaining about a call to verror, which does indeed
never return, because it ends in exit(1).  Very clever of the compiler
to notice that.

> This is fixed by adding <poolmvff> to the MPM list in w3i3mv.nmk.  This 
> may not be the entirely correct fix as it causes some linker warnings 
> about the poolmvff object being specified more than once when building 
> apss.exe, because that rule in commpost.nmk manually includes that 
> object, which seems unnecssary:

We used to organize the system into the MPM plus the pools, and users
would select which pools they needed.  This doesn't really need to be
expressed in the library organization, but that's why MPM doesn't
include any pools (that it doesn't use internally).

>    c:\dev\mps\code\amsss.c(154) : warning C4701: local variable
>                                   'ambigRoot' may be used without having
>                                   been initialized
> and:
>    [...]
>    c:\dev\mps\code\amsss.c(154) : warning C4701: local variable
>                                   'ambigRoot' may be used without having
>                                   been initialized

Those two are identical.  I assume it complained twice about
ambigRoot, and you copied the second one twice.

>    (void *)p; /* unused */
> 
> as that was used in other sources.

There might have been a test file that did that, but for the MPS
sources, there's a macro called UNUSED (which expands into that, I
think).

>    mv2test.c
>    c:\Dev\mps\code\protocol.h(108) : error C2332: 'struct' : missing tag
>                                      name
>    c:\Dev\mps\code\protocol.h(108) : warning C4115: '__unnamed' : named
>                                      type definition in parentheses
>    c:\Dev\mps\code\protocol.h(108) : error C2236: unexpected 'struct'
>                                      '__unnamed'
>    [...]
> 
> This one was odd.  I had to rename the 'interface' parameter to the 
> ProtocolCoerceInstMethod and ProtocolCoerceClassMethod typedefs. 
> Changing it to 'iface' did the job.  I haven't any clue why.

A similar thing happens in VC6 as well.  Nobody's noticed because MVT
isn't really finished, so no one runs mv2test.

It's because "interface" is a non-standard reserved word in VC++.
It's disabled by default, but some of the standard headers use it and
accomodate disabling by
  #define interface struct
instead of bothering to do the Right Thing.

The easiest way around this is to include the standard headers last
(which is what MPS test sources usually do).  This still wouldn't help
if "interface" was used in the body of the file, but it isn't.

FYI, the mpm.c, amsss.c, and poolams.c problems are fixed in my latest
release to Ravenbrook.
-- 
Pekka P. Pirinen
Global Graphics Software Limited



More information about the MPS-discussion mailing list