From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Wragg To: help-gcc@gnu.org Subject: Re: Declaring variables mid-function Date: Sun, 19 Dec 1999 04:01:00 -0000 Message-id: References: <385c11fa@oit.umass.edu> <5vhARpAQ5BX4EwUB@howgarth.demon.co.uk> X-SW-Source: 1999-12/msg00270.html Jamie Walker writes: > In standard C, you cannot declare variables part-way through any > function. Yes you can. ISO C99 was passed a couple of months ago, and allows mid-block declarations. Of course, there are no compilers available yet that comprehensively implement C99, and probably won't be for a couple of years (though mid-block declarations will probably be one of the first C99 features to appear). And people will be using C89 compilers for many years to come, so you probably shouldn't expect to take advantage of C99 features for a while yet... So get used to being specific about C89 or C99, rather than just "standard C". David Wragg From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Wragg To: help-gcc@gnu.org Subject: Re: Declaring variables mid-function Date: Fri, 31 Dec 1999 22:24:00 -0000 Message-ID: References: <385c11fa@oit.umass.edu> <5vhARpAQ5BX4EwUB@howgarth.demon.co.uk> X-SW-Source: 1999-12n/msg00270.html Message-ID: <19991231222400.7pdrtUSyJfW5v2kBLMLEnNx2h4_Z0G_28XIm1xSku2Y@z> Jamie Walker writes: > In standard C, you cannot declare variables part-way through any > function. Yes you can. ISO C99 was passed a couple of months ago, and allows mid-block declarations. Of course, there are no compilers available yet that comprehensively implement C99, and probably won't be for a couple of years (though mid-block declarations will probably be one of the first C99 features to appear). And people will be using C89 compilers for many years to come, so you probably shouldn't expect to take advantage of C99 features for a while yet... So get used to being specific about C89 or C99, rather than just "standard C". David Wragg