Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 01 Dec 2008 12:55:41 +0100
From:      =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To:        Eitan Adler <eitanadlerlist@gmail.com>
Cc:        freebsd-hackers@freebsd.org, d@delphij.net
Subject:   Re: change to ee.c
Message-ID:  <86myfgqfcy.fsf@ds4.des.no>
In-Reply-To: <493214DC.2080904@gmail.com> (Eitan Adler's message of "Sat, 29 Nov 2008 23:21:48 -0500")
References:  <49320FF7.4040901@gmail.com> <4932122A.8070209@delphij.net> <493214DC.2080904@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Eitan Adler <eitanadlerlist@gmail.com> writes:
> Xin LI <d@delphij.net> writes:
> > Tanks for interested in this but I'm afraid that your patch is
> > incorrect.  mkstemp returns a file descriptor rather than a string
> > pointer, therefore, the subsequent open() would have undefined
> > behavior.  It looks like that we actually want fd =3D mkstemp() here.
> Thanks.  If this is the case how come gcc did not return any warnings?

Because ee(1) is built with most warnings disabled, precisely because
the source code is of such poor quality (by modern standards).  Try
this:

$ cd /usr/src/usr.bin/ee
$ make clean
$ make WARNS=3D3 2>&1 | grep -cw warning
72
$ make WARNS=3D6 2>&1 | grep -cw warning=20
188

This is on amd64; you will get fewer on i386.  Someone added casts to
silence legitimate warnings about pointers being assigned to integers,
so gcc will only complain about those assignments on platforms where
sizeof(int) =3D=3D sizeof(void *).

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86myfgqfcy.fsf>