oliverschmidt/cc65 — pull request #79 by dagit (2014-02-10 02:57:28+00:00)
Title: Undefine __STRICT_ANSI__

* `__STRICT_ANSI__` is implied by `-std=c89`
* on some versions of mingw, `__STRICT_ANSI__` removes `tempnam`

Additional references:

* http://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html
* http://sourceforge.net/p/mingw/mingw-org-wsl/ci/master/tree/include/stdio.h#l175

I'm not sure what versions of mingw are strict about the definition of `tempnam`, but I started having the problem when I updated my mingw installation. The second link above is the current HEAD for mingw's standard C library, where you can see the `#ifndef __STRICT_ANSI__`.

Of course there are other ways to address this:

* using `-std=gnu89` instead of `c89` doesn't imply `__STRICT_ANSI__` (tested)
* switch to something else, such as `mkstemp`:
* pros: `tempnam` is deprecated as of [POSIX 2008](http://linux.die.net/man/3/tempnam), whereas `mkstemp` is not.
* cons: Windows calls it `_mktemp`, but deprecates it. We'd have to manually add the cleverness of `tempnam` back in (not hard, but it's more code to maintain).

I made that change that seemed the simplest to me, but I'll let you decide how you want to handle this. I assume that you have the standard set to C89 to help maintain compatibility with Visual Studio. Otherwise, I would have changed to gnu89 and left `__STRICT_ANSI__` defined.

Thanks.