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]

Re: Proposal: Make "int format, different type arg" an error, nota warning


On Thu, 1 Jun 2000, Brad Lucier wrote:

> 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.
[snip]
> These often indicate serious enough problems that I think it would be
> better that they be errors rather than warnings.

I don't see the point. The compiler already provides suitable diagnostics.
So what that it's only a warning - it serves its purpose. If the
programmer knows h[is|er] work, and the code in question is supposed to be
portable, it will be fixed.

I think it would be arrogant for the compiler to reject such code on
32-bit platforms, where its behaviour is perfectly well defined. It would
only upset the majority of users, who still use 32-bit platforms.

Just my f 0,02.

-- 
/ Kamil Iskra  kamil@wins.uva.nl                                          \
| Section Computational Science, Faculty FNWI, Universiteit van Amsterdam |
| tel. +31 20 525 75 35  fax. +31 20 525 74 90                            |
\ Kruislaan 403  room F.202  1098 SJ Amsterdam (NL)                       /


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