jacob navia <> writes:
> Keith Thompson a écrit :
>> jacob navia <> writes:
>>
>>>Mark McIntyre a écrit :
>> [...]
>>
>>>>Unless you have a very new compiler, you can't declare variables
>>>>after
>>>>executable statements. I don't know if lcc-win32 suupports this/
>>>
>>>This is standard C. lcc-win32 supports it.
>>>Declaring variables anywhere is supported since at least 2 years now.
>> Yes, this is standard C. The current C standard is C99.
>> Unfortunately, the current standard is not (yet?) as widely supported
>> as the previous one, C90. Mixing declarations and statements can
>> still cause portability problems if you care about platforms that
>> don't have C99 compilers (or at least C90 compilers that support
>> mixing declarations and statements as an extension).
>
> I know Keith, but you will
> NOT
> have any of those problems using lcc-win32 !!! (
Yes, jacob, we know that.
I do have one major problem with lcc-win32: it only works in a single
environment. Others may find it useful in spite of that. I don't.
> I care about standards and implemented that quite a
> while ago.
Great, but in the real world many of us still have to deal with
pre-C99 implementations, and it would be foolish to ignore that fact.
Fortunately that particular C99 feature, though it's nice to have, is
not essential. It's easy enough to restructure your code so that all
the declarations precede all the statements in each block. The
resulting code (assuming no other problems) is legal in both C90 and
C99.
--
Keith Thompson (The_Other_Keith)
kst- <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.