[v3] parallel mode
Benjamin Kosnik
bkoz@redhat.com
Wed Sep 12 14:53:00 GMT 2007
> Quick question:
>
> -pedantic (well, -pedantic-errors actually) give's:
> include/c++/4.3.0/parallel/partial_sum.h:107: error: ISO C++ forbids
> variable length array ‘borders’
>
> the offending line being:
> difference_type borders[num_threads + 2];
Yeah. I saw a VLA warning with pedantic, and marked it with XXX VLA.
Fixing this would be great!
> Is this necessary? What side-effects would a vector cause? If, as a
> hack, I changed it to vector<difference_type> borders(num_threads+2)
> and used &(*borders.begin()) or something wherever the array is
> expected would it cause big issues?
I think it would probably work.
However, we're trying to keep intra-dependencies minimal, so maybe using
vector is not such a great idea.
Hmmm.
The other approach would be to use dynamic memory allocation.
-benjamin
More information about the Libstdc++
mailing list