[Monetdb-developers] [Monetdb-checkins] MonetDB5/src/modules/mal bbp.mx, , 1.127, 1.128

Stefan Manegold Stefan.Manegold at cwi.nl
Mon Oct 27 10:25:09 CET 2008


On Mon, Oct 27, 2008 at 06:35:34AM +0000, Martin Kersten wrote:
> Update of /cvsroot/monetdb/MonetDB5/src/modules/mal
> In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv4663
> 
> Modified Files:
> 	bbp.mx 
> Log Message:
> Silence compilers
> 
> 
> U bbp.mx
> Index: bbp.mx
> ===================================================================
> RCS file: /cvsroot/monetdb/MonetDB5/src/modules/mal/bbp.mx,v
> retrieving revision 1.127
> retrieving revision 1.128
> diff -u -d -r1.127 -r1.128
> --- bbp.mx	25 Oct 2008 22:08:09 -0000	1.127
> +++ bbp.mx	27 Oct 2008 06:35:32 -0000	1.128
> @@ -867,7 +867,7 @@
>  	int i;
>  	char buf[MAXPATHLEN];
>  	char cwd[MAXPATHLEN];
> -	getcwd(cwd, MAXPATHLEN);
> +	(void) getcwd(cwd, MAXPATHLEN);

This is not "sufficient".
With optimization enabled, gcc still (correctly) complains as follows:
========
 gcc -DHAVE_CONFIG_H -I. -I../../.. -I/ufs/manegold/_/scratch0/Monet/Testing/Current/source/MonetDB5/src/modules/mal -I/ufs/manegold/_/scratch0/Monet/Testing/Current/source/MonetDB5/src/modules/mal -I../atoms -I/ufs/manegold/_/scratch0/Monet/Testing/Current/source/MonetDB5/src/modules/mal/../atoms -I../kernel -I/ufs/manegold/_/scratch0/Monet/Testing/Current/source/MonetDB5/src/modules/mal/../kernel -I../../mal -I/ufs/manegold/_/scratch0/Monet/Testing/Current/source/MonetDB5/src/modules/mal/../../mal -I/ufs/manegold/_/scratch0/Monet/Testing/Current/prefix.--enable-strict_--disable-optimize_--disable-debug_--disable-assert/include/MonetDB -I/ufs/manegold/_/scratch0/Monet/Testing/Current/prefix.--enable-strict_--disable-optimize_--disable-debug_--disable-assert/include/MonetDB/mapilib -I/ufs/manegold/_/scratch0/Monet/Testing/Current/prefix.--enable-strict_--disable-optimize_--disable-debug_--disable-assert/include/MonetDB -I/ufs/manegold/_/scratch0/Monet/Testing/Current/prefix.--enable-strict_--disable-optimize_--disable-debug_--disable-assert/include/MonetDB/common -I/ufs/manegold/_/scratch0/Monet/Testing/Current/prefix.--enable-strict_--disable-optimize_--disable-debug_--disable-assert/include/MonetDB/gdk -I/usr/include/libxml2 -DLIBBBP -O2 -Wall -Wextra -std=c99 -Werror-implicit-function-declaration -Werror -Wpointer-arith -Wdeclaration-after-statement -Wundef -Wp,-D_FORTIFY_SOURCE=2 -D_REENTRANT -c bbp.c  -fPIC -DPIC -o .libs/lib_bbp_la-bbp.o
cc1: warnings being treated as errors
/ufs/manegold/_/scratch0/Monet/Testing/Current/source/MonetDB5/src/modules/mal/bbp.mx: In function 'CMDbbpLocation':
/ufs/manegold/_/scratch0/Monet/Testing/Current/source/MonetDB5/src/modules/mal/bbp.mx:874: warning: ignoring return value of 'getcwd', declared with attribute warn_unused_result
make[8]: *** [lib_bbp_la-bbp.lo] Error 1
========

getcwd() can fail (e.g., incase the current directpry is not readable for
the user; see `man getcwd` for details), and hence, the return value needs
to be checked, and proper measures need to be taken in case getcwd() does
fail (e.g., have default fall-back or trigger warning or error).

Stefan

>  	b = BATnew(TYPE_int, TYPE_str, BBPsize);
>  	if (b == 0)
> 
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Monetdb-checkins mailing list
> Monetdb-checkins at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/monetdb-checkins
> 
> 

-- 
| Dr. Stefan Manegold | mailto:Stefan.Manegold at cwi.nl |
| CWI,  P.O.Box 94079 | http://www.cwi.nl/~manegold/  |
| 1090 GB Amsterdam   | Tel.: +31 (20) 592-4212       |
| The Netherlands     | Fax : +31 (20) 592-4312       |




More information about the developers-list mailing list