Is there a compiler flag that will remove all filename and line number
information from the compiled executable? The example program below
illustrates how at runtime, the filename and line number associated
with the error get written to the screen:
=====fprog.f90=======
PROGRAM fprog
INTEGER :: i, j
PRINT*, 'starting prog'
WRITE(*,'(F5.2,A5)') i, j
END PROGRAM fprog
==================
Output from running program:
starting prog
At line 4 of file fprog.f90 (Unit 6)
Traceback: not available, compile with -ftrace=frame or -ftrace=full
Fortran runtime error: Expected REAL for item 1 in formatted transfer,
got INTEGER
(F5.2,A5)
^
I have tried -s and -g0, but no luck, the source code info still gets
written.
Strange, usually, people prefer to get useful information from the
compiler
when a run-time error occurs... (BTW, I can give you some compiler
vendor
whom error messages are very unclear ;-).
I think that the '-s' flag you used remove only the symbol names out
of the
executable file. '(F5.2,A5)' is not a symbol, it is a format string
and the
compiler must keep it embedded in the executable file.
Regards,
Édouard
On Nov 4, 7:22 pm, John McFarland <john.mcfarl...@swri.org> wrote:
> Is there a compiler flag that will remove all filename and line number
> information from the compiled executable? The example program below
> illustrates how at runtime, the filename and line number associated
> with the error get written to the screen:
> =====fprog.f90=======
> PROGRAM fprog
> INTEGER :: i, j
> PRINT*, 'starting prog'
> WRITE(*,'(F5.2,A5)') i, j
> END PROGRAM fprog
> ==================
> Output from running program:
> starting prog
> At line 4 of file fprog.f90 (Unit 6)
> Traceback: not available, compile with -ftrace=frame or -ftrace=full
> Fortran runtime error: Expected REAL for item 1 in formatted transfer,
> got INTEGER
> (F5.2,A5)
> ^
> I have tried -s and -g0, but no luck, the source code info still gets
> written.
On Nov 5, 2:09 am, Edouard <Edouard.Ca...@irisa.fr> wrote:
> Strange, usually, people prefer to get useful information from the
> compiler
> when a run-time error occurs... (BTW, I can give you some compiler
> vendor
> whom error messages are very unclear ;-).
Sure, but in a program one distributes to others, one may want to
conceal such information -- even perhaps that the program is written
in the dreaded FORTRAN language .
The error messages are very useful for debugging, but I need a way to
turn them off when we distribute the software. In the rare(?) case of
a user experiencing a runtime error, it's unacceptable for our program
to write out source code filename (with full path in some cases!) and
line number information. We already have one case of a user getting
such an error message and then coming back to ask us "I can't find
the /full/path/to/source/code/file on my system, is it possible
something isn't installed as it should be?"
On Nov 5, 7:15 am, Beliavsky <beliav...@aol.com> wrote:
> On Nov 5, 2:09 am, Edouard <Edouard.Ca...@irisa.fr> wrote:
> > Strange, usually, people prefer to get useful information from the
> > compiler
> > when a run-time error occurs... (BTW, I can give you some compiler
> > vendor
> > whom error messages are very unclear ;-).
> Sure, but in a program one distributes to others, one may want to
> conceal such information -- even perhaps that the program is written
> in the dreaded FORTRAN language .