octave-maintainers
[Top][All Lists]
Advanced

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

Re: clang errors building miscellaneous


From: Montgomery-Smith, Stephen
Subject: Re: clang errors building miscellaneous
Date: Sat, 17 May 2014 20:50:59 +0000
User-agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

On 05/17/2014 03:29 PM, Jordi Gutiérrez Hermoso wrote:
> 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?

I am not very knowledgeable about C++.  And I have never used Mercurial
patches.  So first I want to see some discussion about whether vectors
could be used instead, and other general comments on my code.

About requiring gcc - this and the lssa error are the only errors with
clang.  So the amount of work to get octave-forge to work with clang is
rather minimal.  And then FreeBSD people will be very happy.

reply via email to

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