[gdal-dev] SIGPIPE missing due to not including signal.h
Greg Troxel
gdt at ir.bbn.com
Sun Nov 1 08:43:35 PST 2015
I am building on netbsd-6 i386 with gcc 4.5.3.
I got an error about SIGPIPE being undefined. The man page says that
signal.h is required to be included, and posix agrees:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/signal.html
I couldn't find an include of signal.h; the following patch resolves the
error.
Index: port/cpl_port.h
===================================================================
--- port/cpl_port.h (revision 31282)
+++ port/cpl_port.h (working copy)
@@ -125,6 +125,7 @@
/* Standard include files. */
/* ==================================================================== */
+#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
gmake[1]: Entering directory '/usr/home/gdt/SOFTWARE/GEO/gdal/apps'
/bin/ksh /home/gdt/SOFTWARE/GEO/gdal/libtool --mode=compile --tag=CC gcc -I/home/gdt/SOFTWARE/GEO/gdal/port -I/home/gdt/SOFTWARE/GEO/gdal/gcore -I/home/gdt/SOFTWARE/GEO/gdal/alg -I/home/gdt/SOFTWARE/GEO/gdal/ogr -I/home/gdt/SOFTWARE/GEO/gdal/ogr/ogrsf_frmts -I/home/gdt/SOFTWARE/GEO/gdal/gnm -I/home/gdt/SOFTWARE/GEO/gdal/apps -g -O2 -Wall -Wdeclaration-after-statement -Wextra -Winit-self -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat -Werror=format-security -Wno-format-nonliteral -Werror=vla -Wdeclaration-after-statement -Wno-clobbered -I/home/gdt/SOFTWARE/GEO/gdal/frmts/vrt -DOGR_ENABLED -I/usr/pkg/include -I/home/gdt/SOFTWARE/GEO/gdal/port -I/usr/pkg/include -DGDAL_COMPILATION -I/usr/pkg/include/json-c -I/home/gdt/SOFTWARE/GEO/gdal/ogr/ogrsf_frmts/geojson -DHAVE_GEOS=1 -I/usr/pkg/include -c -o gdalserver.lo gdalserver.c
libtool: compile: gcc -I/home/gdt/SOFTWARE/GEO/gdal/port -I/home/gdt/SOFTWARE/GEO/gdal/gcore -I/home/gdt/SOFTWARE/GEO/gdal/alg -I/home/gdt/SOFTWARE/GEO/gdal/ogr -I/home/gdt/SOFTWARE/GEO/gdal/ogr/ogrsf_frmts -I/home/gdt/SOFTWARE/GEO/gdal/gnm -I/home/gdt/SOFTWARE/GEO/gdal/apps -g -O2 -Wall -Wdeclaration-after-statement -Wextra -Winit-self -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wformat -Werror=format-security -Wno-format-nonliteral -Werror=vla -Wdeclaration-after-statement -Wno-clobbered -I/home/gdt/SOFTWARE/GEO/gdal/frmts/vrt -DOGR_ENABLED -I/usr/pkg/include -I/home/gdt/SOFTWARE/GEO/gdal/port -I/usr/pkg/include -DGDAL_COMPILATION -I/usr/pkg/include/json-c -I/home/gdt/SOFTWARE/GEO/gdal/ogr/ogrsf_frmts/geojson -DHAVE_GEOS=1 -I/usr/pkg/include -c gdalserver.c -fPIC -DPIC -o .libs/gdalserver.o
gdalserver.c: In function 'RunServer':
gdalserver.c:428:9: warning: implicit declaration of function 'signal'
gdalserver.c:428:16: error: 'SIGPIPE' undeclared (first use in this function)
gdalserver.c:428:16: note: each undeclared identifier is reported only once for each function it appears in
gdalserver.c:428:25: error: 'SIG_IGN' undeclared (first use in this function)
../GDALmake.opt:650: recipe for target 'gdalserver.lo' failed
gmake[1]: *** [gdalserver.lo] Error 1
gmake[1]: Leaving directory '/usr/home/gdt/SOFTWARE/GEO/gdal/apps'
GNUmakefile:93: recipe for target 'apps-target' failed
gmake: *** [apps-target] Error 2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 180 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20151101/8b668caf/attachment.sig>
More information about the gdal-dev
mailing list