How to stop GNU Fortran Compiler to show debug info during runtime?

0

The following lin is used to compile an executable from the Fortran source code

gfortran -funderscoring -O3 -Wall -c -fmessage-length=0 -o "src/abc.o" "../src/abc.f"

When I run my program in command prompt and errors occur, it will show runtime errors in the command prompt (see the runtime error example below). I want to disable the display of the runtime errors as I am worried that this will reveal the source code. How can I do that?

At line 429 of file ../src/abc.f (unit = 5, file = 'stdin')
Fortran runtime error: Bad value during integer read

Error termination. Backtrace:

Could not print backtrace: libbacktrace could not find executable to open
#0  0xffffffff
#1  0xffffffff
#2  0xffffffff
#3  0xffffffff
#4  0xffffffff
#5  0xffffffff
#6  0xffffffff
#7  0xffffffff
#8  0xffffffff
#9  0xffffffff
#10  0xffffffff
#11  0xffffffff
#12  0xffffffff
#13  0xffffffff
gcc
gfortran
asked on Stack Overflow Oct 30, 2019 by Ken T

1 Answer

1

I am not aware of any such option and I am not useful of its usefulness anyway. Fortran rewuires an error condition to be handled eventhough it does not prescribe the form of the message.

You can always use the iostat= or err= specifiers to handle the error conditions yourself in anu way you like.

answered on Stack Overflow Oct 30, 2019 by Vladimir F

User contributions licensed under CC BY-SA 3.0