Opened 6 years ago

Closed 6 years ago

#6451 closed defect (fixed)

MSG - errors "no format arguments" for CplError() when building frmts/msg/msgdataset.cpp

Reported by: shot2 Owned by: warmerdam
Priority: low Milestone: 2.1.0
Component: GDAL_Raster Version: svn-trunk
Severity: normal Keywords: MSG
Cc:

Description

Trunk from 2016/04/12, Ubuntu 14.04 amd64, gcc-4.8 c++0x.

In a paranoid "-Werror=format-security" context, building the MSG/Eumetsat driver fails with

error: format not a string literal and no format arguments

at two places, lines 141 and 186 of frmts/msg/msgdataset.cpp:

CPLError( CE_Failure, CPLE_AppDefined, (sErr+"\n").c_str() );
CPLError( CE_Failure, CPLE_AppDefined,
                  sErr.c_str() );

The issue obviously resides in the lack of a formatting argument for ".c_str()"

Change History (1)

comment:1 by Even Rouault, 6 years ago

Resolution: fixed
Status: newclosed

trunk r33950, branches/2.1 r33951 "MSG: fix build with -Werror=format-security (reported by shot2, #6451)"

Note: See TracTickets for help on using tickets.