Operating System - OpenVMS
1752767 Members
5114 Online
108789 Solutions
New Discussion

Re: The simple C math example for WSIT

 
SOLVED
Go to solution
Ryan Rogalla
Occasional Contributor

The simple C math example for WSIT

Hello anybody out there and thank you in advance.

 

I am going through the WSIT documentation for setting up the simple C match service and I am getting all sorts of complilation errors when performing @BUILD-MATH-SERVER.COM.  The previous steps worked fine.  I tried to change the template that genrates the code to use /* */ for comments instead of //.  This worked for the generated files, but I am getting all kinds of other errors from files I know nothing about.  Below are a few of the errors.

 

// * Items are licensed to the U.S. Government under vendor's standard     * ...........................................................^ %CC-E-NLCHAR, An unexpected newline character is present in a character constant. at line number 10 in module FIXUP of text library SYS$COMMON:[SYSLIB]WSI$LIBRARY.TLB;1

// * Items are licensed to the U.S. Government under vendor's standard     * ...........................................................^ %CC-W-CHAROVERFL, A character constant value requires more than sizeof(int) bytes of storage. at line number 10 in module FIXUP of text library SYS$COMMON:[SYSLIB]WSI$LIBRARY.TLB;1

    unsigned cvt$v_invalid_output_type : 1; .......................................^ %CC-E-NOSEMI, Missing ";". at line number 92 in module CVTDEF of text library SYS$COMMON:[SYSLIB]SYS$STARLET_C.TLB;1

    unsigned cvt$v_invalid_option : 1; ..................................^ %CC-E-NOSEMI, Missing ";". at line number 93 in module CVTDEF of text library SYS$COMMON:[SYSLIB]SYS$STARLET_C.TLB;1

    unsigned cvt$v_result_infinite : 1; ...................................^ %CC-E-NOSEMI, Missing ";". at line number 94 in module CVTDEF of text library SYS$COMMON:[SYSLIB]SYS$STARLET_C.TLB;1

 

7 REPLIES 7
Dennis Handly
Acclaimed Contributor

Re: The simple C math example for WSIT

>I tried to change the template that genrates the code to use /* */ for comments instead of //.

 

It looks like you are using C89 vs the C99 Standard, which allows // comments.

H.Becker
Honored Contributor

Re: The simple C math example for WSIT

Check whether you have a DCL symbol CC defined, which specifies the c89 standard, like /standard=ansi89. You may want to use cc/standard= relaxed, c99 or latest. If the source code does not fully comply with the c99 standard, the latter two keywords will result in other informationals, warnings or errors.  Relaxed is what the VMS header files are written for. And relaxed is default when you have no /standard at all.

Hoff
Honored Contributor

Re: The simple C math example for WSIT

Please post output from the following three DCL commands:

 

CC /VERSION

SHOW SYMBOL CC

SHOW LOGICAL DECC$*

 

This output will indicate your compiler version, whether you have a symbol around for the compiler (and what it is), your OpenVMS version, what OpenVMS architecture you are working on, as well as whatever run-time library feature customizations might be in play here.

 

There are also C RTL patch kits around for various OpenVMS versions.  The above won't show those patches, though that might become a factor as you're testing the results of the build.

 

 

Ryan Rogalla
Occasional Contributor

Re: The simple C math example for WSIT

here is the output from your questions

 

any help would be appreciated.

 

cc /version

%DCL-I-IGNQUAL, qualifiers appearing before this item were ignored  \VERSION\ HP C V7.3-018 on OpenVMS IA64 V8.3-1H1

 

show symbol/cc

 CC == "CC/FLOAT=IEEE/IEEE_MODE=DENORM/STANDARD=VAXC/SHOW=DICTIONARY/LIST/WARN=(DISABLE=(CVTDIFTYPES,EXTRAPRAGARGS,SIGNEDKNOWN,UNSU PPTYPE,UNKNOWNPRAGMA,CDDATTR,PROTOSCOPE,IGNOREEXTRA,INTRINSICINT,CXXPRAGMANA,LONGEXTERN),ENABLE=(UNREFADECL,UNINIT1,UNINIT2,UNINIT3, UNINIT4,CONTROLASSIGN,BADSUBSCRIPT,SUBSCRBOUNDS,SUBSCRBOUNDS1,SUBSCRBOUNDS2,ALIGNMENT),WARNINGS=(UNINIT1,UNINIT2,UNINIT3,UNINIT4,BAD SUBSCRIPT,SUBSCRBOUNDS,SUBSCRBOUNDS1,SUBSCRBOUNDS2),ERRORS=(OTHERMEMBER))/EXTERN=RELAXED_REFDEF/SHARE_GLOBALS"

 

sho logical decc$*

(LNM$PROCESS_TABLE)

  "DECC$FD_LOCKING" = "TRUE"

(LNM$JOB_8C1FD6C0)

(LNM$GROUP_000100)

(LNM$SYSTEM_TABLE)

  "DECC$CRTLMAP" = "SYS$SHARE:DECC$SHR"   "DECC$FD_LOCKING" = "TRUE"   "DECC$SHR_AV" = "DECC$SHR"

(LNM$SYSCLUSTER_TABLE)

(DECW$LOGICAL_NAMES)

(ENVIRONMENT_DEV)

Hoff
Honored Contributor
Solution

Re: The simple C math example for WSIT

That CC command implies multiple problems lurk here.

 

First off, there should not be a CC symbol left around for generic CC compilations.  Compilations that require that should be implemented within very specific build procedures, preferrably mapped to a different verb, and definitely not overmapped into the generic CC command.   (Similarly, setting up other DCL symbols that overmap any of the other DCL command verbs is also generally cosindered poor practice.)  

 

Secondary, that list of C compiler qualifiers implies the code that's involved is not so much being ported being covered over with a metric ton of spackle and paint and hackery, and it'll probably be an unstable code-base at best.  

 

The /STANDARD=VAXC disables most of the error checks, and many of which will point ot legitimate run-time bugs in the code, and that particular CC command disables most of the rest.   Enabling and fixing the compiler-generated errors typically provides a substantial payback in terms of application stability and maintainability. 

 

For generic builds here, delete the CC symbol.

 

Better, get that generic symbol from the user and system-wide logins and - only where needed - move it over into the application-specific build procedures.  Avoid use of "CC" as the compiler symbol (don't overlap DCL verbs, as a general rule), and preferably don't equate the symbol as a global at all, where that's feasible.  It's common to see CC 'ccopt' here, and set up the ccopt symbol with what's required for that specific compilation.

Ryan Rogalla
Occasional Contributor

Re: The simple C math example for WSIT

Thanks for your help! It was greatly appreciated.  And yes I know we have covered up some problems in the past.  I will bring some of this to the discussion with our development team.  I have been maintaining our VMS code base for a while, but I am not yet a seasoned vet.

 

one more question.  How do you set the cc symbol back to it's DCL default?

 

thanks again for your insight.

Ryan

Hoff
Honored Contributor

Re: The simple C math example for WSIT

How?

 

Clean the CC and related cruft out of whatever command procedure is setting up the cruft, log out, and log in.

 

Hack: remember to issue DELETE /SYMBOL /GLOBAL CC each time you log in.

 

Bigger hack: add DELETE /SYMBOL /GLOBAL CC to the end of your login.

 

And if that's really the solution the development team has proposed, they'd better have a gold-plated reason for that solution, or I'd suggest acquiring an adult chaperone for the team.