|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: Miod Vallat (miod
online.fr)
Date: Sat Dec 01 2007 - 16:23:53 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> Hi Marc, this might be a little off-topic, but I am still wondering
> what's the meaning of 'portable' here you are referring to. As we can
> see, most GNU systems (such as Linux distros) can be run on machines of
> many different architectures, so I suppose they are portable actually.
> How to define the word 'portable'? The code doesn't obey the standard is
> not portable?
There are several standards (with different degrees of braindeadness)
attempting to describe the expected behaviour of a Unix-like system:
Posix, Single Unix, XPG, etc.
Most systems (including OpenBSD) strive to match Posix and Single Unix.
The GNU C library found on most Linux systems also tries to match these
standards, but also adds a lot of GNU extensions (such as strfry() and
memfrob(), among other useless things).
Having strlen return zero for an argument of NULL, instead of causing a
segmentation fault, is one of them.
Since it is a GNU extension, code supposed to be able to run on systems
which do not have a GNU C Library (such as Solaris or MacOS X) can not
rely on it.
Miod
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]