On Sun, 29 Apr 2018 16:15:23 +0000, Jan Panteltje wrote:
> On a sunny day (Sun, 29 Apr 2018 15:46:34 +0000 (UTC)) it happened
> Martin Gregorie wrote in
> :
>
>>On Sun, 29 Apr 2018 14:50:08 +0100, Gareth's Downstairs Computer wrote:
>>
>>> On 29/04/2018 13:43, Ahem A Rivet's Shot wrote:
>>>> One way to create subtle and nasty bugs is to write code that
>>>> depends on the implementation rather than the spec.
>>>
>>> All code depends upon the implementation.
>>>
>>> For example, string handling in C is not part of the language spec.
>>
>>However, string handling in C is, and always has been, part of the
>>standard library. There is a specification (manpage) for every string
>>handling function and there is (or should be) a set of tests that
>>confirm that the code meets the specification. Hence you should write
>>code that uses conformant calls to these functions.
>>
>>The same applies for every function in the Standard Library just as it
>>does for 'bigger' languages than C and their support libraries. If you
>>write a conformant call that doesn't work as advertised then you've
>>found a bug and should report it.
>
> Indeed,
> /var/www/pub/libc.info.txt
> (in other directories and forms on other systems)
> always was, and is, my C programming reference.
> Without that you are stuck in Linux.
>
Agreed, though my goto source for any set of related functions that I'm
not familiar with is
"UNIX Systems Programming for SVR4" by David A Curry (pub O'Reilly)
Its still very relevant despite its age (my copy is dated July 1996)
because the standard library has scarcely changed since then: So far I
haven't found anything in it that didn't work exactly as described,
whether I was using a UNIX (NCR and DEC) or Linux since then.
It's a better source than manpages if you're starting to use an
unfamiliar set of library functions because it does good job of
explaining how they work together and interact - something that's often
missing from manpages - and has useful example code as well as
explanations in a similar style to the K&R book.
--
Martin | martin at
Gregorie | gregorie dot org
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|