This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [v3] parallel mode


 
> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]