[#4644] gifti_io.c:3293 compiler warning in printf

Please log in

State: more information
Closed
Date:
2010-02-26 08:28
Priority: more information
3
Submitted By:
Nick Schmansky (nschmans)
Assigned To: more information
Richard Reynolds (rickr)
Hardware: 
None
Product: 
None
Operating System: 
other
Component: 
None
Version: 
None
Severity: 
None
Resolution: 
None
Summary: more information
gifti_io.c:3293 compiler warning in printf

Detailed description

gcc 3.4.6 issues the following warning:

gifti_io.c: In function `gifti_compare_coordsys':
gifti_io.c:3293: warning: long long int format, long unsigned int arg (arg 2)

a fix is this change (change to long unsigned int) :

< if(lverb>2) printf("-- coordsys xform diff at offset %lld\n",
---
> if(lverb>2) printf("-- coordsys xform diff at offset %lu\n",

this is not a bug, but rather allows building w/o warnings (freesurfer build only allows building w/o warnings)



Response

Message

Date: 2010-03-04 10:47
Sender: Richard Reynolds

separated out with cast


Date: 2010-02-27 10:09
Sender: Nick Schmansky

This happens on Linux CentOS 4, 64b, using gcc v3.4.6, with the -Wall -Werror options. (sorry for my lacking bug report! i should know better)


Date: 2010-02-27 09:41
Sender: Richard Reynolds

I have not seen this warning on any system. What OS, version and compile options do you have for that file?

It is odd that 'long long' would get promoted to 'unsigned long'. I guess both sizes must be 8 for you, is that right?

I will separate the division and force a 'long long' result, since it would make no sense for signed/unsigned to result in unsigned (not that any of these values are negative).

Attached Files:

Name Download
No Files Currently Attached

Changes:

Field Old Value Date By
Operating SystemNone2010-03-04 10:47rickr
status_idOpen2010-03-04 10:47rickr
assigned_tonone2010-02-27 09:41rickr