[erlang-questions] Strings - deprecated functions

ok@REDACTED ok@REDACTED
Sat Nov 25 02:49:58 CET 2017


A couple of years ago I was working through a Java book.
Not one of the examples got a clean compile.  Not one.
oddly enough, it was string-handling functions that had
been deprecated, and oddly enough, in my environment the
old functions still did everything I needed.

It's not just Erlang and Java.  I had C code using some of
the classic string functions in ways I had carefully ensured
were correct.  Porting to the next version of the Unix
flavour I was using, the linker screamed at me about unsafe
functions.  Since I wanted other people to use the program
and didn't want them looking down on me, I spent a merry
couple of hours changing the code to use memcpy instead of
strcpy and so on.

Again, I have a program which works fine in Solaris 10, Open
Solaris, and Solaris 11 Express.  It uses a mix of old
functions (hey, if the code still works, why change it, am I
right?) and new functions (if you can call POSIX 2008 "new".)
But OpenIndiana?  I am still baffled as to what combination of
feature test macros I can set to make the program compile, and
am coming to the conclusion that there isn't one.

Did I mention the trouble I've been having with Ubuntu 17.10?
I'll spare you that, but let's just say that putting standard
headers in nonstandard places really really does not help.

I don't really have a solution.  It seems as though the only
thing you can do to ensure that old code continues to work is
to keep a VM imagine with a complete copy of the environment
it used to work in.

Good luck plugging new libraries into that, though.






More information about the erlang-questions mailing list