Ticket #396 (closed task: invalid)

Opened 2 years ago

Last modified 4 months ago

GCC warning - shp2pgsql

Reported by: colivier Owned by: pramsey
Priority: low Milestone: PostGIS 2.0.0
Component: loader/dumper Version: trunk
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

Changed 2 years ago by mloskot

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.

Changed 2 years ago by pramsey

  • milestone changed from PostGIS 1.5.1 to PostGIS 2.0.0

Changed 2 years ago by pramsey

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

Changed 14 months ago by strk

  • component changed from postgis to loader/dumper

Changed 4 months ago by pramsey

  • status changed from new to closed
  • resolution set to invalid

Not seeing this anymore?

Note: See TracTickets for help on using tickets.