On 11 July 2014 10:13, Anton Lundin <gla...@acc.umu.se> wrote:
> glance> for (int i=0;i<3;i++) ?

for that to work on older versions e.g. MSVC 2003, /Tp has to be used
(like jeff mentioned, we can mark the input to be C++) and then extern
"C" wrapping would be needed to preserve the binary interface.

on even older versions like MSVC 1998, /Tp exists but the actual
intermix feature from c99 is a bit messed up. the lexical scanner does
recognize it, but then it assigns a non-local scope to the iterator.
so you can do things like:

for (int i = 0; i < 10; i++)
    puts("stuff");
i = 0; // <---

i would advice against this particular feature if targeting older
MSVC, but for third party source projects i usually follow their usage
of "for" loops.
for my own managed projects, this:

int i = 0;
while (i < ...) {... i++ }

remained as a habit.

lubomir
--
_______________________________________________
subsurface mailing list
subsurface@hohndel.org
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to