[Pyrex] array cdefs

Lenard Lindstrom len-l at telus.net
Tue Dec 4 04:28:04 CET 2007


I don't believe standard C++ even supports them directly. A C++ vector 
is a traditional heap allocated array wrapped in a class template.

Matthieu Brucher wrote:
> In fact, it is not C++ at all, it's C99 (variable lenth arrays, only 
> exist for C99 compilers, not C89 ones like Visual Studio for instance).
>
> Matthieu
>
> 2007/12/3, Greg Ewing < greg.ewing at canterbury.ac.nz 
> <mailto:greg.ewing at canterbury.ac.nz>>:
>
>     moreilcon at gmail.com <mailto:moreilcon at gmail.com> wrote:
>     > /* C code, works well */
>     > void
>     > foo(int size)
>     > {
>     >     int array[size];
>     > }
>
>     Strictly speaking this is a C++ thing and isn't
>     standard C:
>
>     % gcc -c -ansi -pedantic foo.c
>     foo.c: In function `foo':
>     foo.c:2: warning: ISO C90 forbids variable-size array `array'
>
>     Pyrex only generates standard C code, so it doesn't
>     support this.
>
>     --
>     Greg
>
>     _______________________________________________
>     Pyrex mailing list
>     Pyrex at lists.copyleft.no <mailto:Pyrex at lists.copyleft.no>
>     http://lists.copyleft.no/mailman/listinfo/pyrex
>
>
>
>
> -- 
> French PhD student
> Website : http://miles.developpez.com/
> Blogs : http://matt.eifelle.com and http://blog.developpez.com/?blog=92
> LinkedIn : http://www.linkedin.com/in/matthieubrucher 
> <http://www.linkedin.com/in/matthieubrucher>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Pyrex mailing list
> Pyrex at lists.copyleft.no
> http://lists.copyleft.no/mailman/listinfo/pyrex
>   


-- 
Lenard Lindstrom
<len-l at telus.net>




More information about the Pyrex mailing list