Liste des Groupes | Revenir à cl c |
David Brown <david.brown@hesbynett.no> writes:I want to run nano (or vi, or ed), in a shell running a pure ansi COn 06/06/2024 10:27, Malcolm McLean wrote:[...]It does work. But my compiler warns about rmpnam() being deprecated.>
I presume you mean "tmpnam()" here. No, it has not been deprecated -
not even in C23. I could be wrong, but this sounds like one of MSVC's
arbitrary self-declared deprecations, using scare tactics to encourage
people to use MSVC's own functions rather than standard C functions,
thus locking you into their tools and platform.
You're right, tmpnam() is not deprecated either by ISO C or by POSIX.
But tmpfile() is likely to be better for most purposes. It creates a
file and returns a FILE*. tmpnam() returns a string pointer, and it's
possible that some other process could create a file with the same name
before the caller has a chance to create it.
(mkstemp() is more flexible, but is not defined by ISO C.)
Les messages affichés proviennent d'usenet.