At 07:16 PM 2/22/05 +0100, Paul Colin Gloster wrote:
>On Tue, Feb 22, 2005 at 01:05:49PM -0500, Robert Adsett wrote:
>"At 05:45 PM 2/22/05 +0000, kc9dag wrote:
>[..]
> >
> >for this chunk of code:
> >
> >45 for(unsigned int x = 0; x <= pagecount; x++)
>
>This would be valid C++ but not C"
>
>Actually this is valid ANSI C (C99), but not valid ex-ANSI C (C89) nor
>valid K & R C.
So I belatedly realized. I'm not sure it's an improvement, but that's
another issue entirely. The question is whether the possible improvement
in locality outweighs the possible obscurity in local declaration. I'll
reserve judgement on that.
>A copy of K&R or Harbison & Steele wouldn't go awry for covering these
>sort of details."
>
>Such books could leave someone misinformed and out of date, though
>actually I am ignorant of Harbison & Steele so if their book was
>published this decade it may be current.
I don't know if they've been updated to cover C99 or not. They were
updated to cover C89 and I don't believe any valid C89 constructs have been
invalidated. I don't think there is much risk in either of them. There
may be more recent books. Another item to remember is a lot of C compilers
(particularly embedded) are barely C89 compliant never mind C99
compliant. Heck some of them aren't even pre-ANSI K&R complaint.
Robert
" 'Freedom' has no meaning of itself. There are always restrictions,
be they legal, genetic, or physical. If you don't believe me, try to
chew a radio signal. "
Kelvin Throop, IIIMessage
Re: [AVR-Chat] What does this error mean?
2005-02-22 by Robert Adsett
Attachments
- No local attachments were found for this message.