------- Comment #5 from kargl at gcc dot gnu dot org 2007-09-03 03:43 ------- (In reply to comment #4) > (In reply to comment #2) > > The number 2147483648 is too big. The minus sign is a unary operator. > > Either use the compiler option that Jerry mentioned or use 'k = - huge(k) - > > 1' > > > option: -fno-range-check is supposed to be the default for the compiler
Huh? No, the default for the compiler is to perform range checking. > "In some cases, options have positive and negative forms; the negative form of > -ffoo would be -fno-foo. This manual documents only one of these two forms, > whichever one is not the default.' Looks like a bug in the documentation. I'll fix that shortly. > It is in 4.1.X, looks like it has changed in 4.2.1 There was a bug in gfortran that allowed it to accepted -2147483648. I fixed the bug with 2006-09-07 Steven G. Kargl <[EMAIL PROTECTED]> * gfortran.h (gfc_integer_info): Eliminate max_int. * arith.c (gfc_arith_init_1): Remove initialization of max_int. (gfc_arith_done_1): Remove clearing of max_int. (gfc_check_integer_range): Fix range chekcing of overflow. * simplify.c (gfc_simplify_not): Construct mask that was max_int. You can read about the problem here: http://gcc.gnu.org/ml/fortran/2006-09/msg00008.html -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33285