[PATCH 5/5] Limit the scope of gasidx in add_plan_to_notes

Lubomir I. Ivanov neolit123 at gmail.com
Fri Jul 11 04:41:25 PDT 2014


On 11 July 2014 10:13, Anton Lundin <glance at 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
--


More information about the subsurface mailing list