Opened 15 years ago

Closed 13 years ago

#396 closed task (invalid)

GCC warning - shp2pgsql

Reported by: colivier Owned by: pramsey
Priority: low Milestone: PostGIS 2.0.0
Component: utils/loader-dumper Version: master
Keywords: shp2pgsql - gcc warning Cc:

Description

shpopen.c: In function 'SHPOpen':
shpopen.c:456: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
shpopen.c:466: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
shpopen.c:545: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
shpopen.c: In function 'SHPReadObject':
shpopen.c:1327: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
dbfopen.c: In function 'DBFUpdateHeader':
dbfopen.c:337: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
dbfopen.c: In function 'DBFClose':
dbfopen.c:520: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
dbfopen.c: In function 'DBFWriteAttribute':
dbfopen.c:1114: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
dbfopen.c: In function 'DBFWriteAttributeDirectly':
dbfopen.c:1283: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
dbfopen.c: In function 'DBFWriteTuple':
dbfopen.c:1429: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
dbfopen.c: In function 'DBFReadTuple':
dbfopen.c:1473: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
getopt.c: In function 'pgis_getopt':
getopt.c:69: warning: ignoring return value of 'write', declared with attribute warn_unused_result
getopt.c:69: warning: ignoring return value of 'write', declared with attribute warn_unused_result
getopt.c:69: warning: ignoring return value of 'write', declared with attribute warn_unused_result
getopt.c:80: warning: ignoring return value of 'write', declared with attribute warn_unused_result
getopt.c:80: warning: ignoring return value of 'write', declared with attribute warn_unused_result
getopt.c:80: warning: ignoring return value of 'write', declared with attribute warn_unused_result
$gcc --version
gcc (Ubuntu 4.4.1-4ubuntu8) 4.4.1
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ uname -a
Linux ns39258.ovh.net 2.6.31.5-grsec-xxxx-std-ipv4-64 #1 SMP Thu Oct 29 16:55:22 UTC 2009 x86_64 GNU/Linux

Change History (5)

comment:1 by mloskot, 15 years ago

This is a well-known warning in Shapelib (so also in GDAL/OGR).

The modern versions of GCC are getting stricter from version to version. It says it's a bad idea to ignore return value from any function which may fail in run-time, especially filesystem I/O calls. And it is a bad idea, but most of the legacy code base do not care about it. The only option here is to ignore it or submit patch to Shapelib.

comment:2 by pramsey, 15 years ago

Milestone: PostGIS 1.5.1PostGIS 2.0.0

comment:3 by pramsey, 15 years ago

We'll fix this when we upgrade our version of shapelib.

comment:4 by strk, 14 years ago

Component: postgisloader/dumper

comment:5 by pramsey, 13 years ago

Resolution: invalid
Status: newclosed

Not seeing this anymore?

Note: See TracTickets for help on using tickets.