octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: clang errors building miscellaneous


From: Jordi Gutiérrez Hermoso
Subject: Re: clang errors building miscellaneous
Date: Sat, 17 May 2014 16:29:50 -0400

On Sat, 2014-05-17 at 19:45 +0000, Montgomery-Smith, Stephen wrote:
> In order to build the package miscellaneous, I had to apply the attached
> patch.  

patch is:
> -  Array<octave_idx_type> bidc [maxdims], eidc [maxdims];
>    //
>    Array<octave_idx_type> step (dim_vector (maxdims, 1));
> +  // Array<octave_idx_type> bidc [maxdims], eidc [maxdims];
> +  Array<octave_idx_type> *bidc, *eidc;
> +  bidc = new Array<octave_idx_type> [maxdims];
> +  eidc = new Array<octave_idx_type> [maxdims];

Okay this works as a g++ extension because it's a C99 feature that gcc
allows in C++, but I suppose clang is technically correct to not allow
this (blegh, can't we just require gcc?). Your patch is therefore
almost right, modulo your later correction, but please don't comment
out removed code. Just delete it. Remembering old versions of the code
is what Mercurial is for.

Also, preferrably send Mercurial patches. Someone has to undertake the
chore of writing a commit message, and the less of a chore you make it
for the person applying it, the more likely it is for your patch to
get quickly applied.

> I think there should be a better way to deal with this. but this
> probably means editing Array.h in octave.

What better way did you have in mind? There's nothing sacrosanct about
Array.h that we can't change between two major Octave versions.

I think we could just use std::vector instead of C arrays here. Is
there an obstacle with this approach?

- Jordi G. H.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]