On Aug 17, 2012, at 11:11 AM, Matt Beaumont-Gay wrote: > Can you explain the rationale behind this warning a little bit? It > fires on some more-or-less reasonable code like this snippet from the > Python Imaging Library: > > libImaging/Draw.c:448:51: error: cast from function call of type > 'double' to non-matching type 'int' [-Werror,-Wbad-function-cast] > hline8(im, CEIL(xx[0]-0.5), ymin, FLOOR(xx[1]+0.5), ink); > ^~~~~~~~~~~~~~~~ > libImaging/Draw.c:40:50: note: expanded from macro 'FLOOR' > #define FLOOR(v) ((v) >= 0.0 ? (int) (v) : (int) floor(v)) > ^~~~~~~~ >
It shouldn't be under -Wall. gcc does not and you just convinced me further. It is something some one might find useful to have (and got it implemented on gcc). More interesting cases are (int)ptrFunc(), etc. - Thanks, Fariborz _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
