change to ee.c
Dag-Erling Smørgrav
des at des.no
Mon Dec 1 03:55:42 PST 2008
Eitan Adler <eitanadlerlist at gmail.com> writes:
> Xin LI <d at 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 = 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=3 2>&1 | grep -cw warning
72
$ make WARNS=6 2>&1 | grep -cw warning
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) == sizeof(void *).
DES
--
Dag-Erling Smørgrav - des at des.no
More information about the freebsd-hackers
mailing list