This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Proposal: Make "int format, different type arg" an error, not a warning


When you have something like

printf ("%d\n", (HOST_WIDE_INT) &i);

on the alpha, then the format is for a 32-bit int, while the actual
argument is a 64bit long.  There are other similar cases.  (Another common
problem is assuming, e.g., (7 - strlen(a)) is an int, while strlen
returns a size_t, which is a 64bit long on the alpha.)

These often indicate serious enough problems that I think it would be
better that they be errors rather than warnings.

Brad Lucier

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]