[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Who's responsible for kdelibs/arts/flow/gsl ?
From:       Thomas Leitner <tom () radar ! tu-graz ! ac ! at>
Date:       2001-10-24 18:25:02
[Download RAW message or body]


> On Wed, Oct 24, 2001 at 03:04:18PM +0200, Thomas Leitner wrote:
> > Who's responsible for kdelibs/arts/flow/gsl? This library seems to
> > depend on GCC to a large extend. For instance with an ANSI-C compiler
> > I get this:
> >
> > cc: Error: gslfilter.c, line 33: In the declaration of "poly", "iorder" is
> > not constant, but occurs in a context that requires a constant expression.
> > (needconstexpr)
> >   GslComplex root, poly[iorder + 1];
> > ------------------------^
> >
> > cc: Error: gslmath.c, line 85: In the declaration of "tbuffer", "n_points"
> > is not constant, but occurs in a context that requires a constant
> > expression. (needconstexpr)
> >   char *s, tbuffer[FLOAT_STRING_SIZE * 2 * n_points];
> > -------------------------------------------^
>
> The fix is easy. C89 doesn't allow you to allocate an array of
> non-const size (I think C99 might though). Just do:
>   GslComplex root, *poly;
>   poly = malloc (iorder + 1);

I'm well aware of this solution. However this problem occurs many times
in the code and fixing it all like that is awkward. As the dimensions
of the arrays seem to have some natural upper limit (it's the filter
order which cannot be quite high) I thought that the original authors
might want to use constant array dimensions and just add a check that
the dimension is not exceeded.

Tom

 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic