OT: Requesting C advice
Les Mikesell
lesmikesell at gmail.com
Thu May 31 22:29:42 UTC 2007
Mike McCarty wrote:
>> That must be something recent. Also some people believed that it did in
>
> IIRC, it was mentioned in K&R v1.
>
> [snip]
>
>> This part I am sure of, because I have had to fix many, many peoples
>> code due to this belief. The ANSI comittee may have changed the
>> standard, but I would bet that a lot of older compilers still generate
>> code with no initialization.
I sort-of remember some discussion about this back when people were
trying to run unix on machines without memory management. Usually the
OS would zero blocks of memory before allocating it to a process for
security reasons but I don't think C ever guaranteed that. Lint should
always have warned you about using uninitialized variables, though.
> Older? ANSI C is since 1989. I guess one could characterize 19 years
> as "older". :-)
C was old before ANSI came along. Maybe we could revive the discussion
of why "abcd"[2] must evaluate to 'c'.
--
Les Mikesell
lesmikesell at gmail.com
More information about the fedora-list
mailing list