[Info-vax] Whither VMS?
Richard B. Gilbert
rgilbert88 at comcast.net
Mon Oct 5 09:06:14 EDT 2009
P. Sture wrote:
> In article <habq5n$pi6$3 at naig.caltech.edu>,
> glen herrmannsfeldt <gah at ugcs.caltech.edu> wrote:
>
>> Michael Kraemer <M.Kraemer at gsi.de> wrote:
>> < glen herrmannsfeldt schrieb:
>>
>> <> Well, the C gets() function, I believe still part of the standard,
>> <> has no way to know the length of the buffer. The only answer is
>> <> not to use it, but it does seem fair to blame the language in that
>> <> case.
>>
>> < To be nitpicking: it's not part of the language,
>> < neither are all other functions.
>> < But I agree, at least the doc's should deprecate its use.
>>
>> I have seen that discussed. There are some questions in K&R as
>> to the library being part of the language. Most agree that it is
>> for ANSI C.
>>
>> <> Otherwise, yes, it is up to programmers to check at the
>> <> appropriate points.
>>
>> And to always use fgets() instead of gets().
>>
>
> Is there a handy reference to this stuff? I mean a summary of what C
> calls to avoid and why (possibly detailing safe and unsafe
> circumstances).
>
I've never seen or heard of one. It's not necessary to "avoid" certain
calls. It IS necessary to understand exactly what you are doing. C is
really just a "portable" assembler. You have to keep in mind that a
slip on your part might crash your process or even your system.
C hands you both near total control AND near total responsibility! Use
it with care. Consider whether or not C is the appropriate language for
what you are trying to do.
More information about the Info-vax
mailing list