Compilation fortran编译执行中的非期望回溯信息
我正在开发一个fortran代码(Standard2003),其中我必须控制所有非标称出口 在执行没有参数的代码时(它需要许多参数),我收到了预期的退出代码+一些未询问的回溯信息,如下所示:Compilation fortran编译执行中的非期望回溯信息,compilation,fortran,gfortran,backtrace,Compilation,Fortran,Gfortran,Backtrace,我正在开发一个fortran代码(Standard2003),其中我必须控制所有非标称出口 在执行没有参数的代码时(它需要许多参数),我收到了预期的退出代码+一些未询问的回溯信息,如下所示: ./test_1 Error | Wrong number of inputs in test_1 STOP 128 Backtrace for this error: #0 0x0000003b9b0ac584 in wait () from /lib64/libc.so.6 #1
./test_1
Error | Wrong number of inputs in test_1
STOP 128
Backtrace for this error:
#0 0x0000003b9b0ac584 in wait () from /lib64/libc.so.6
#1 0x00007ff41d8ff00d in ?? () from /usr//lib64/libgfortran.so.3
#2 0x00007ff41d90082e in ?? () from /usr//lib64/libgfortran.so.3
#3 0x00007ff41d90112f in _gfortran_stop_numeric () from usr//lib64/libgfortran.so.3
#4 0x000000000041f7d4 in _gfortran_stop_numeric_f08 ()
#5 0x000000000041b680 in MAIN__ ()
#6 0x000000000041f74d in main ()
奇怪的是,我的编译中没有(我认为)调用回溯的优化标志
gfortran -Wall -Wextra -Wuninitialized -Wno-maybe-uninitialized -O2 -finit-local-zero -I/opt/cots/netcdf_4.2_gfortran/include -L/usr//lib64 -Wl,-rpath,/usr//lib64 -L/opt/cots/netcdf_4.2_gfortran/lib -Wl,-rpath,/opt/cots/netcdf_4.2_gfortran/lib -o test_1 test_1.o -lnetcdff -lnetcdf -lz -lm
我在调试模式下有它。但我正在使用优化的可执行文件
有人知道我如何处理回溯信息吗
我假设它与代码无关,因为它出现在停止命令之后
非常感谢 对于默认为
-fbacktrace
的GCC版本,可以使用-fno backtrace
。哪个编译器版本?大多数人都会喜欢回溯,IIRC它是故意添加的默认值。请参见因此try-fno backtrace
相关我不需要回溯,因为我没有调试,我正在强制崩溃,我需要的是格式化退出。这似乎是默认行为,因此我将使用-fno回溯。谢谢[我的编译器是gcc 4.7.2]