This is the mail archive of the guile@cygnus.com mailing list for the Guile project.


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

Re: reordering (Re: Smob documentation)


Telford Tendys wrote:

> IMHO, this should work:
>
>         const int size = 42;
>         int things[ size ];
>
> But at the moment gcc will tell me that `size' is not constant!

So sorry, your opinion is wrong; GCC is right.

This has nothing to do with how well GCC optimizes; it is a requirement of C. The
size of an array in a declaration must be a constant expression (an expression
involving only literals or sizeof).

BTW, that's true of C++, too.

--
Branko Čibej                 <branko.cibej@hermes.si>
HERMES SoftLab, Litijska 51, 1000 Ljubljana, Slovenia
voice: (+386 61) 186 53 49   fax: (+386 61) 186 52 70



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