[Verse-dev] usage of perror function breaks compatibility with EVC3

Emil Brink verse-dev@blender.org
Thu, 15 Jul 2004 10:12:00 +0200


On Wed, 14 Jul 2004 19:51:38 +0200
Eskil Steenberg <eskil@obsession.se> wrote:

> Hi
> 
> >
> > I know that if someone's compiler can't handle some libc-functions
> > it is the problem of the compiler or of the one who uses it...
> > however i have to use the code and have to use this compiler and
> > don't want to ship patched libraries with my code, so is it possible
> > that you change the perror call to fprintf(stderr, something)?
> > thanks!
> >
> This is something Emil has done. He is currently on vacation but will
> be back in a few weeks.  Emil and I disagree a bit in thees issues. He
> is more inclined to use standard libs and often later versions of  
> compilers and libs.

Well, I refuse to see a problem with using *standard* library functions,
such as strcpy(), strcmp(), and so on. Using them makes the code tens of
times more readable, and reduces the risk for errors.

I was under the impression that perror() was actually not a totally
standard thing, and leaving it in the code is probably a mistake on my
part. However, from reading the manual page it seems to be a standard
ANSI C function and thus should be safe to use.

I'm not sure why you would need to use a C++ runtime library with the
Verse code, since it's all C...

> I on the other hand am much more conservative. I  think that verse
> should be compilable on very old installations with old compilers.

Sure, but at some point it becomes silly. This is not such a point,
however.

> I think i can win this one since it is a function only used one time, 
> and its a function that cane easily be implemented in a different way
> to remove the problem.

Absolutely, there is no real need for perror() and it can be easily re-
written to just use a fprintf() call as Thorsten indicated.

Regards,

/Emil