[PATCH] [TRIVIAL] libiberty, fix includes for mktemp()

Ian Lance Taylor iant@google.com
Tue Sep 22 14:08:00 GMT 2009


> On Sat, Sep 5, 2009 at 11:23 PM, Ozkan Sezer <sezeroz@gmail.com> wrote:
> Hello:  The folllowing trivial patch fixes warnings emitted from
> libiberty/choose-temp.c in mingw* builds:
> choose-temp.c:68: warning: implicit declaration of function 'mktemp'
> Mingw* headers declare mktemp() in io.h which is included from
> unistd.h.
>
> --- a/libiberty/choose-temp.c   2007-01-31 22:05:50.000000000 +0200
> +++ b/libiberty/choose-temp.c   2009-09-05 21:33:41.000000000 +0300
> @@ -22,6 +22,10 @@ Boston, MA 02110-1301, USA.  */
>  #endif
>
>  #include <stdio.h>     /* May get P_tmpdir.  */
> +#include <sys/types.h>
> +#ifdef HAVE_UNISTD_H
> +#include <unistd.h>
> +#endif
>  #ifdef HAVE_STDLIB_H
>  #include <stdlib.h>
>  #endif
>
> Tested by compiling binutils for x86_64-pc-mingw32.  Please apply
> to gcc and sourceware.org.  (I don't have write permissions.)

This patch is OK with a ChangeLog entry.

It would be helpful is somebody volunteered to apply it.

Thanks.

Ian



More information about the Gcc-patches mailing list