Sent to me in a private email - and not yet checked. ------------------------------------------------------------------ In gcc/fortran/error.c this statement case 'u': arg[pos].type = TYPE_UINTEGER; looks like it's missing a 'break'. If a translator provided a format string translation that contained the substring "%ulu", then an argument of type TYPE_ULONGINT would be fetched and stored in arg[pos].u.ulongintval, and later, spec[n++].u.uintval would be used. Which would lead to wrong results on 64-bit platforms.
from error.c(error_print) 00470 case 'u': 00471 arg[pos].type = TYPE_UINTEGER; 00472 00473 case 'l': 00474 c = *format++; 00475 if (c == 'u') 00476 arg[pos].type = TYPE_ULONGINT; 00477 else if (c == 'i' || c == 'd') 00478 arg[pos].type = TYPE_LONGINT; 00479 else 00480 gcc_unreachable (); 00481 break; ....so, yes, without analysis I would say that the report is correct. Confirmed. I have given it the "wrong-code" keyword because it is likely to be true and to raise this out of the noise. Paul
I can confirm it's missing a break: Index: error.c =================================================================== --- error.c (revision 147105) +++ error.c (working copy) @@ -533,6 +533,7 @@ case 'u': arg[pos].type = TYPE_UINTEGER; + break; case 'l': c = *format++;
Subject: Bug 39576 Author: fxcoudert Date: Thu May 7 22:01:34 2009 New Revision: 147257 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=147257 Log: PR fortran/39576 * error.c (error_print): Add missing break statement. Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/error.c
Fixed.