Whenever I compile 4.3.0 using --with-mysql, I recieve this error message:

my_tempnam.c:103: the use of tempnam' is dangerous, better usemkstemp'

Anyone know how I get around this?

[edit] I know this is supposed to be a warning that can be safely ignored, but compiling stops right here with no other error messages:

ext/mysql/libmysql/my_tempnam.lo: In function my_tempnam':
/usr/local/src/php-4.3.0/ext/mysql/libmysql/my_tempnam.c:103: the use of
tempnam' is dangerous, better use `mkstemp'
[root@localhost php-4.3.0]#

I guess I should also point out that this is on RedHat 7.2.[/edit]

    FIXED
    After looking hard for a fix, and getting no help from PHP.NET, I finally changed line 103 of my_tempnam.c
    to read:

    res=mkstemp((char*) dir); /* Use stand. dir with prefix */

    Now I'm not a C programmer by any stretch, but I was able to compile
    successfully and install. Everything appears to be working correctly.

      a month later

      i apreciate your post , because it really was a help to me. thanks again.

        a month later

        The function mkstemp returns a file descriptor, the function tempnam returns a string with a file name. This two functions are not(!) compatible.

          I have found no call to this function in source. so I think you can make a comment from the code in this function.

          The description says, that this function is used for old ISAM-Code. This code is probably removed.

            Write a Reply...