koitsu wrote:
Imperial wrote:
Code:
/usr/local/lib/libglib-2.0.so.3400.0: warning: stpcpy() is dangerous GNU crap; don't use it
RL LOL -- that warning is stupid. The glib folks (assuming it's coming from them -- maybe it's coming from the compiler) should be ashamed. stpcpy() is POSIX compliant (specifically POSIX 2008), specifically quoting the
FreeBSD man page STANDARDS section:
Quote:
The stpcpy() and stpncpy() functions conform to IEEE Std 1003.1-2008 (``POSIX.1'').
stpcpy() returns a pointer to the trailing NULL that was copied into the destination; strcpy() returns a pointer to the start of the beginning of the string copied. If the warning is annoying (and I agree it is), you can accomplish the exact same thing as stpcpy() by using a combination of strcpy() and strrchr() (searching for
'\0' in strrchr() -- yes,
strrchr(buf, '\0') will work and find the last occurrence of a NULL in buf)).
I don't know for sure, but that warning sounds like something from Theo de Raadt.
Quote:
Note: this is hardcore C++ bullshit and I do not do C++ (this is a great example why.
).
Oh I can't stand C++. That was my first language, but when I discovered Kernighan & Ritchie's The C Programming Language, and then Roberto Ierusalimschy's Programming in Lua, which is written in the same style, I never wanted to touch C++ again. It is there, and I accept it, because that's life.
Quote:
I had no idea what a vtable was
until I read this gobbledegook. Way to make programming confusing for virtually no gain. Check out my hate-on!
What language are you more familiar with, then? Vtables aren't unique to C++, of course, and the concept can be crudely mimicked in C.
Quote:
You might be getting a lot of these warnings/issues as a result of compiler differences between yourself and the author. g++ -v (assuming it's the g++ compiler being used and not clang) would be useful here from both of you, I think.
Good point. For posterity, I was able to build all of this with gcc 4.2.1.
Code:
$ g++ -v
Reading specs from /usr/lib/gcc-lib/i386-unknown-openbsd5.3/4.2.1/specs
Target: i386-unknown-openbsd5.3
Configured with: OpenBSD/i386 system compiler
Thread model: posix
gcc version 4.2.1 20070719