MPS issue job002179

TitleMPS client code cannot determine MPS Version at compile time
Statussuspended
Prioritynice
Assigned userGareth Rees
OrganizationRavenbrook
DescriptionMPS client code cannot determine MPS Version at compile time

Client code may wish to conditionally-compile (with #ifdef) according to MPS version, but this is not possible because it cannot determine MPS Version at compile time. The MPS header file mps.h does not define MPS_RELEASE or MPSVersion().

Client code might wish to know, at compile-time, about interface changes (for example a new interface function), or about internal MPS changes associated with an MPS release (for example changed MPS performance or behaviour), and conditionally-compile accordingly.

(Note: client code cannot even determine MPS version at run-time. The MPSVersion() function and arenaGlobals->mpsVersionString variable are not made available to the client).
AnalysisRHSK 2009-11-11
What are the actual client requirements? One example we have (see evidence [1]) is adding a new interface function that is expected to be a permanent addition to the mps.h interface. For this case, client code would probably like to be able to test a monotonically increasing numeric MPS version code, #defined in mps.h, as in:
  #if MPS_VERSION_CODE > 168778
  ... use new interface function ...
  #endif
A p4 changelist number might be suitable.

Client code might also wish to determine MPS version at run-time, and confirm it is the same as (or, alternatively, compatible with) the version of headers the client was compiled with.

GDR 2013-03-08: If you look at the actual customer requirement [1], it was because he wanted to be able to test his code against an old MPS release in order to determine whether the problem he was encountering had been newly introduced ("I will try to step back a few version numbers to see if it is new"). Since his code depended on features of the newer MPS release, it wasn't straightforward to step backwards.

However, even if MPS_VERSION_CODE or something similar were provided in the public interface, it wouldn't have made the customer's task much (if at all) easier: any use of newer features would still need to be appropriately rewritten or guarded with a #if when trying to compile against an older MPS release.
How foundcustomer
Evidence[1] <http://info.ravenbrook.com/mail/2008/04/28/18-36-08/0.txt>
Observed in1.108.1
Introduced in1.100.0
Created byRichard Kistruck
Created on2009-11-11 15:27:09
Last modified byGareth Rees
Last modified on2013-03-19 11:39:28
History2009-11-11 RHSK Created.
2013-03-08 GDR More analysis, set priority to "nice"
2013-03-12 RB Suspended, won't fix.