4
我正試圖編寫一個程序,該程序將在執行無效操作時停止,無論它如何與GFortran一起編譯。用ifort我可以這樣做:GFortran相當於ieee_exceptions
use ieee_exceptions
....
logical :: halt
....
call ieee_get_halting_mode(IEEE_USUAL,halt)
call ieee_set_halting_mode(IEEE_USUAL,.True.)
....
! Something that may stop the program
....
call ieee_set_halting_mode(IEEE_USUAL,halt)
GFortran有一個模塊類似於ifort的ieee_exceptions
嗎?或者更好的方法是在不知道如何編譯程序或將使用哪種編譯器的情況下停止暫停模式?
乾杯,現貨。 – SimpleSimon
實際上,這似乎是gfortran 5的一部分:https://gcc.gnu.org/wiki/GFortran/News#gfortran_5 – patrickvacek
@patrickvacek:的確如此。好極了!我已經更新了答案。 – janneb