[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Most usual functions can either be missing, or be buggy, or be limited on some architectures. This section tries to make an inventory of these portability issues. By definition, this list will always require additions. Please help us keeping it as complete as possible.
snprintf
snprintf
and vsnprintf
truncate
the output and return the number of bytes that ought to have been
produced. Some older systems return the truncated length (e.g., GNU C
Library 2.0.x or IRIX 6.5), some a negative value (e.g., earlier GNU C
Library versions), and some the buffer length without truncation (e.g.,
32-bit Solaris 7). Also, some buggy older systems ignore the length and
overrun the buffer (e.g., 64-bit Solaris 7).
sprintf
sprintf
and vsprintf
return the
number of bytes written, but on some old systems (SunOS 4 for
instance) they return the buffer pointer instead.
unlink
unlink
causes the given files to be
removed only after there are no more open file handles for it. Not all
OS's support this behaviour though. So even on systems that provide
unlink
, you cannot portably assume it is OK to call it on files
that are open. For example, on Windows 9x and ME, such a call would fail;
on DOS it could even lead to file system corruption, as the file might end
up being written to after the OS has removed it.
>>
>>
right shift of a signed type replicates the
high bit, giving a so-called "arithmetic" shift. But care should be
taken since the ISO C standard doesn't require that behaviour. On those
few processors without a native arithmetic shift (for instance Cray
vector systems) zero bits may be shifted in, the same as a shift of an
unsigned type.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |