Operating System - OpenVMS
1748000 Members
4701 Online
108757 Solutions
New Discussion

Re: Compiler Options and COMP values on Disk

 
SOLVED
Go to solution
Hoff
Honored Contributor

Re: Compiler Options and COMP values on Disk

You're correct, John; I wouldn't expect nor suggest the use of #file or various of the C-ish #pragma directives here.

 

But as for using language features, that particular suggestion can cut both ways.  Porting code to VMS is getting more and more interesting as the years pass.  C99 use has become widespread in open source, and code dependent on the newer Fortran standards are increasingly common, too.  (I don't port as much COBOL around, but I'd be surprised if that code wasn't also encountering problems.)  And these feature deficits are often why I'm conditionalizing the source code.

 

Steven Schweda
Honored Contributor

Re: Compiler Options and COMP values on Disk

 
H.Becker
Honored Contributor

Re: Compiler Options and COMP values on Disk

>>>  I don't see "any #file or #line directives left in the output", and a "#" in column one seems to be pretty Fortran-compatible.  If a COBOL compiler is harder to satisfy, then additional options include writing one's own preprocessor, and filtering the output of a sub-ideal preprocessor.

or simply use gcc which has a -P option:  Inhibit generation of linemarkers in the output from the preprocessor. This might be useful when running the preprocessor on something that is not C code, and will be sent to a program which might be confused by the linemarkers.
Dennis Handly
Acclaimed Contributor

Re: Compiler Options and COMP values on Disk

>I don't see "any #file or #line directives left in the output", and a "#" in column one seems to be pretty Fortran-compatible.

 

Well these lines:

# 1 "ALP$DKC0:[SMS.ITRC]arch_test_c.for;2"

 

The "#line" directive is C and C++ Standard.  But the preprocessor "# line-number [optional filename]" form is also pretty common.

 

>simply use gcc which has a -P option:

 

Right.