debugging - segmentation fault created by fortran if tests -


suppose have following code

    if (a.eq.0.or.m(a)) 

with integer , m(1:3) array of logicals. if equal 0, expect first test catch , second 1 never evaluated. however, if use intel fortran compiler , compiles with

    -check 

then got segmentation fault. no error occurs without debugging option. standard behavior? many languages said explicitly in manual for

    if (a.or.b) 

if true b not evaluated. fortran standard explicitly requires , b can evaluated if not impact final result?

fortran allows for, but not guarantee, short-circuit evaluation of logical operators. safe, have write code under assumption each operand evaluated.


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -