Re: Compile fail, alpha5 & gcc 4.3.3 in elog.c - Mailing list pgsql-hackers

From GenieJapo
Subject Re: Compile fail, alpha5 & gcc 4.3.3 in elog.c
Date
Msg-id 1270210410.4119.15.camel@geniejapo-laptop
Whole thread Raw
In response to Compile fail, alpha5 & gcc 4.3.3 in elog.c  (Josh Berkus <josh@agliodbs.com>)
List pgsql-hackers
Hi,

I use Ubuntu 9.04 (GCC 4.3.3).
Build was failed too.
I was able to compile with some small correction. 
All are the one that relates only to the return value of write() and fgets(). 

(1) src/backend/utils/error/elog.c
elog.c: In function 'write_console':
elog.c:1698: error: ignoring return value of 'write', declared with attribute warn_unused_result
elog.c: In function 'write_pipe_chunks':
elog.c:2390: error: ignoring return value of 'write', declared with attribute warn_unused_result
elog.c:2399: error: ignoring return value of 'write', declared with attribute warn_unused_result

(2) src/interfaces/libpq/fe-connect.c
fe-connect.c: In function 'PasswordFromFile':
fe-connect.c:4403: error: ignoring return value of 'fgets', declared with attribute warn_unused_result

(3) src/port/common.c
common.c: In function 'handle_sigint':
common.c:247: error: ignoring return value of 'write', declared with attribute warn_unused_result
common.c:250: error: ignoring return value of 'write', declared with attribute warn_unused_result
common.c:251: error: ignoring return value of 'write', declared with attribute warn_unused_result

(4) src/bin/psql/prompt.c
prompt.c: In function 'get_prompt':
prompt.c:255: error: ignoring return value of 'fgets', declared with attribute warn_unused_result

Regards,
Genie Japo

> Guys,
> 
> Hmmm.   I appear to have had a compile error with that alpha5 tarball,
> in elog.c.  No special options on compile, except an alternate directory
> and port.
> 
> Ubunutu 9.10 server
> GCC 4.3.3
> Tries both:
> ./configure --with-pgport=5490 --prefix=/usr/local/pgsql/9.0/
> and:
> ./configure --with-pgport=5490 --prefix=/usr/local/pgsql/9.0/
> --enable-debug -enable-cassert
> 
> make[4]: Entering directory
> `/usr/local/src/postgresql-9.0alpha5/src/backend/utils/error'
> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
> -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing
> -fwrapv -Werror -I../../../../src/include -D_GNU_SOURCE   -c -o assert.o
> assert.c
> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
> -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing
> -fwrapv -Werror -I../../../../src/include -D_GNU_SOURCE   -c -o elog.o
> elog.c
> cc1: warnings being treated as errors
> elog.c: In function ‘write_console’:
> elog.c:1698: error: ignoring return value of ‘write’, declared with
> attribute warn_unused_result
> elog.c: In function ‘write_pipe_chunks’:
> elog.c:2390: error: ignoring return value of ‘write’, declared with
> attribute warn_unused_result
> elog.c:2399: error: ignoring return value of ‘write’, declared with
> attribute warn_unused_result
> make[4]: *** [elog.o] Error 1
> 
> -- 
>                                   -- Josh Berkus
>                                      PostgreSQL Experts Inc.
>                                      http://www.pgexperts.com
> 



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Compile fail, alpha5 & gcc 4.3.3 in elog.c
Next
From: Magnus Hagander
Date:
Subject: Re: walreceiver is uninterruptible on win32