Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

DEC C V6.0 vs 6.4 command-lines

 
SOLVED
Go to solution
Edward Brocklesby
Occasional Visitor

DEC C V6.0 vs 6.4 command-lines

Hi all,

I'm currently shipping an application, which is distributed as source code and compiled by the end-user as part of the installation process. The code in question has a lot of statements that generate the %CC-W-PTRMISMATCH warning under DEC Cv6.0; to stop this breaking the compile, I've added /WARNINGS=(DISABLE=PTRMISMATCH) to the compiler command line. However, it seems that some time after V6.0 (I've noticed this behaviour on 6.4 at least), the warning in question changed to %CC-W-PTRMISMATCH1, and is no longer disabled by this command line; customers using V6.4 are then not able to build the source.

I've considered a couple of solutions to this; either checking the version of the compiler in the installation DCL procedure, and setting an MMS/MMK variable to change the command line passed to the compiler, or generating a CC.COM before build which includes the correct command line.

However, I'm not sure how to go about either of these; in particular, although CC/VERSION prints the compiler's version number, is there a way to 'catch' this in a DCL symbol to use?

Any hints or other ideas for a solution would be appreciated :).

(Before anyone says "fix the warnings in the code".. yes, I'd like to do that, but the non-VMS parts of the code weren't written by me, and I'd like to avoid changing that; the changes to fix all occurances of this warning would proably require rewriting half the software :(. )
3 REPLIES 3
Martin P.J. Zinser
Honored Contributor

Re: DEC C V6.0 vs 6.4 command-lines

sys$system:decc$show_versions.com
might prove instructive as how to find the version number in a
general way (/version was not
supported on all versions).

Generally speaking I still think
it would be a good idea to fix the code.
Craig A Berry
Honored Contributor
Solution

Re: DEC C V6.0 vs 6.4 command-lines

If there is an include file that will be included in all the affected code, you could put in something like:

#ifdef __VMS

/* FIXME -- Please fix the code so
* this desperate suppression of
* error messages is unnecessary.
*/
#if defined (__DECC_VER) && __DECC_VER >= 60400000

#pragma message disable PTRMISMATCH1

#else

#pragma message disable PTRMISMATCH

#endif
#endif
Highlighted
Edward Brocklesby
Occasional Visitor

Re: DEC C V6.0 vs 6.4 command-lines

Thanks, #pragma message disable does exactly what I require :).

(Yes, the code should be fixed, and I've left Craig's comment in the source because of this.

Unfortunately I really don't have time to do it myself, and the author of the code in question doesn't consider it enough of a problem to warrant fixing it when there's other more pressing problems to deal with.

Without being able to change the source, I think this workaround is a reasonable solution.)

Thanks again for the help. :)