Opened 12 years ago

Closed 12 years ago

#2283 closed defect (fixed)

Formatting warnings for GPX driver

Reported by: hobu Owned by: Even Rouault
Priority: lowest Milestone:
Component: default Version: unspecified
Severity: normal Keywords:
Cc:

Description

I'm getting these warnings on OS X 10.5 Leopard.

libtool: compile:  g++ -g -O2 -Wall -I.. -I../.. -I/usr/local/include -I/Users/hobu/dev/svn/gdal/port -I/Users/hobu/dev/svn/gdal/gcore -I/Users/hobu/dev/svn/gdal/alg -I/Users/hobu/dev/svn/gdal/ogr -I/Users/hobu/dev/svn/gdal/ogr/ogrsf_frmts -DOGR_ENABLED -D_REENTRANT -I/Users/hobu/dev/svn/gdal/port -I/usr/local -I/usr/local/include -I/usr/local/include -I/usr/local -I/usr/local/include -DHAVE_EXPAT -c ogrgpxdatasource.cpp  -fno-common -DPIC -o ../o/.libs/ogrgpxdatasource.o
ogrgpxdatasource.cpp: In member function 'int OGRGPXDataSource::Open(const char*, int)':
ogrgpxdatasource.cpp:273: warning: format '%d' expects type 'int', but argument 4 has type 'XML_Size'
ogrgpxdatasource.cpp:273: warning: format '%d' expects type 'int', but argument 5 has type 'XML_Size'

I think r13173 was the culprit.

Change History (1)

comment:1 Changed 12 years ago by Even Rouault

Resolution: fixed
Status: newclosed

Thanks. Fixed in r14046 by casting to int. (I didn't observe that warning on Linux)

In fact, the commit you've pointed introduced the real cause of the warning, but a previous commit of mine (r13858) helped revealing such problems (r13859) by introducing the CPL_PRINT_FUNC_FORMAT macro in functions with printf-like signatures.

I've tagged CPLDebug as a CPL_PRINT_FUNC_FORMAT function, but have forgotten to add it for CPLError. So be prepared to see a new wave of warnings when I will commit that...

Note: See TracTickets for help on using tickets.