Mika Miettinen wrote: > Enrico Migliore wrote: > >> > >> Right now I got some problems which I'm planning to solve during the >> weekend, >> here are two examples: >> >> -------------------------------------------------------------------------------------- >> >> rvoid argv_init(int argc, char **argv, char **envp) >> { >> rchar *chkjh; >> chkjh = (rchar *) rnull; >> rchar *chkcp; <--- MSVC flags this as a compilation error >> >> ..\jvm\src\argv.c(127) : error C2275: 'rchar' : illegal use of this >> type as an expression >> -------------------------------------------------------------------------------------- > > > > I remember banging my head into this same kind of problem some years > ago. You must always put variable definitions at the start of the > block; so the start of the function should probably go like this: > > rvoid argv_init(int argc, char **argv, char **envp) > { > rchar *chkjh = (rchar *) rnull; > rchar *chkcp = (rchar *) rnull; > rchar *chkbcp = (rchar *) rnull; > ... > > The problem is that > chkjh = (rchar *) rnull; > is no longer an initialization, it is an assignment and these > two are different beasts altogether. > > I seem to remember ANSI C requires this definitions-at-the-start > behaviour and MSVC seems to do it by the book. Hope I'm not > mistaken (I haven't actually used MSVC for quite some time). > > -- Mika > > Hi Mika, that might be the solution. I'll try it in the afternoon. Enrico -- Cordiali Saluti Enrico Migliore /* ************************************************************** * * Enrico Migliore - co-founder and senior electronics engineer * * FATTI srl - OSGi, GPRS, and GSM systems * * Via Donatello 48 - 20020 - Solaro - Milano - Italy * Phone: +39 (0)2 9679 9655 * Fax: +39 (0)2 9679 9373 * http://www.fatti.com * * e-mail: enrico.migliore@fatti.com * ************************************************************** */