Sujet : Re: Running an editor from ANSI C
De : david.brown (at) *nospam* hesbynett.no (David Brown)
Groupes : comp.lang.cDate : 06. Jun 2024, 10:07:16
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v3ru84$1eafb$1@dont-email.me>
References : 1 2 3 4 5
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0
On 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.
I gather you are doing all this for fun, which is great. You have set yourself a challenge with a total disregard for practicality or reality, and are writing this stuff for your own enjoyment. We all need that kind of project at times.
But it seems strange to limit yourself to an ancient and impractical language (C89/C90, which you inaccurately call "ANSI C") for "portability" and then worry about compiler-specific warnings.
If you want to check if something is /actually/ deprecated or obsolescent, I'd recommend using a good source - such as future C standards (<
https://open-std.org/JTC1/SC22/WG14/www/docs/n3220.pdf>) or the cppreference.com site <
https://en.cppreference.com/w/c/io/tmpnam>.
(Of course, tmpnam() does have plenty of potential problems, and for real code, you'd be better off using Windows-specific and/or POSIX-specific functions for this kind of thing. But that would be against your rules.)