GNOME Bugzilla – Bug 544031
db-summary used integer format in printf
Last modified: 2013-09-14 16:52:43 UTC
On my 64bit machine when compiling evolution-data-server I can see warnings like: camel-folder-summary.c:3236: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘size_t’ These are quite serious and can (in particular cases) cause troubles, as far as I can tell.
Created attachment 114932 [details] [review] proposed eds patch for evolution-data-server; Fixed warnings: camel-folder-summary.c: In function 'camel_folder_summary_migrate_infos': camel-folder-summary.c:1049: warning: return makes integer from pointer without a cast camel-folder-summary.c: In function 'content_info_to_db': camel-folder-summary.c:3201: warning: format '%d' expects type 'int', but argument 3 has type 'size_t' camel-folder-summary.c:3205: warning: format '%d' expects type 'int', but argument 3 has type 'size_t' camel-folder-summary.c:3212: warning: format '%d' expects type 'int', but argument 3 has type 'size_t' camel-folder-summary.c:3216: warning: format '%d' expects type 'int', but argument 3 has type 'size_t' camel-folder-summary.c:3228: warning: format '%d' expects type 'int', but argument 3 has type 'size_t' camel-folder-summary.c:3232: warning: format '%d' expects type 'int', but argument 3 has type 'size_t' camel-folder-summary.c:3236: warning: format '%d' expects type 'int', but argument 3 has type 'size_t' camel-vee-folder.c: In function 'vee_folder_remove_folder': camel-vee-folder.c:884: warning: suggest parentheses around assignment used as truth value camel-mbox-summary.c: In function 'summary_header_to_db': camel-mbox-summary.c:306: warning: format '%d' expects type 'int', but argument 4 has type 'size_t' I kept those others for now. Also, the %d is fixed just by the re-type the argument, because it's size_t, not gsize or similar type.
Created attachment 114938 [details] [review] proposed eex patch for evolution-exchange; I noticed there these warnings, all fixed. One is more-or less serious, guess which. :) camel-exchange-summary.c: In function 'message_info_to_db': camel-exchange-summary.c:313: warning: format '%d' expects type 'int', but argument 2 has type 'size_t' camel-exchange-summary.c:313: warning: format '%d' expects type 'int', but argument 4 has type 'size_t' e-cal-backend-exchange.c: In function 'build_msg': e-cal-backend-exchange.c:1833: warning: unused variable 'mime_type' e-cal-backend-exchange-calendar.c: In function 'send_objects': e-cal-backend-exchange-calendar.c:2012: warning: unused variable 'tzcomp' exchange-component.c: In function ‘new_connection’: exchange-component.c:331: warning: assignment from incompatible pointer type exchange-component.c:345: warning: assignment from incompatible pointer type
Commit it Milan.
eds part committed to trunk. Committed revision 9191. eex part committed to trunk. Committed revision 1703.