On Tuesday, 6 March 2018 10:06:41 UTC, sisyphus wrote: > > > > -----Original Message----- > From: Brian Gladman > Sent: Tuesday, March 06, 2018 8:39 PM > To: mpir-...@googlegroups.com <javascript:> > Subject: Re: [mpir-devel] Re: Can't Compile dll_mpir_gc in VS15 > > > On 06/03/2018 09:20, sisy...@optusnet.com.au <javascript:> wrote: > >> For a simple demo of the sort of thing I'm thinking of, consider the > >> following C program: > >> > >> /**************/ > >> #include <stdio.h> > >> > >> int main (void) { > >> > >> int a = 3; > >> printf("%d\n", a); > >> > >> int b = 6; > >> printf("%d\n", b); > >> > >> return 0; > >> } > >> > >> /***************/ > >> > >> That builds fine for me on Windows with gcc, but using cl I get: > >> > >> try.c(8) : error C2143: syntax error : missing ';' before 'type' > >> try.c(9) : error C2065: 'b' : undeclared identifier > > > > I'll check this out. Have you tracked down why cl fails when this > > happens? > > I believe it's a compliancy issue - ie that myode is valid only under C99 > (or C11 ? .. or something like that). > The script I posted can be made suitable for 'cl' by moving the > declaration > of b to the "declaration" section of the program. Another solution is to > apply some scoping: > > /*************************/ > #include <stdio.h> > > int main (void) { > > int a = 3; > printf("%d\n", a); > > { > int b = 6; > printf("%d\n", b); > } > > return 0; > } > > /*************************/ > > Cheers, > Rob > > Thanks Rob, it turned out to be no more than a bad edit on my part :-( > >
-- You received this message because you are subscribed to the Google Groups "mpir-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to mpir-devel+unsubscr...@googlegroups.com. To post to this group, send email to mpir-devel@googlegroups.com. Visit this group at https://groups.google.com/group/mpir-devel. For more options, visit https://groups.google.com/d/optout.