Re: Constant initialization question

From: Geoffrey.Coram <Geoffrey.Coram_at_.....>
Date: Mon Nov 14 2005 - 09:10:58 PST
Arpad -
Since built_in_function(const_arg_list) is a "constant_expression"
(as is constant_array_expression) per the LRM, I think the compiler
is wrong to give you an error.  It's curious that min gives you a
problem whereas ceil does not ...

1364-2005 spent some time looking at various functions -- including
user-defined ones -- as to which ones, when operating on constant
expressions, would return constant expressions.  I think they went
as far as to define a list of functions allowed in parameter
declarations.

-Geoffrey


"Muranyi, Arpad" wrote:
> 
> Hello everyone,
> 
> I would like to ask a question about initializing
> constants.
> 
> I am getting compiler errors when I write something
> like this:
> 
> parameter real Min_t = min(min(min(Tr1[1], Tr2[1]), Tf1[1]), Tf2[1]);
> 
> Where Tr1, Tr2, Tf1, Tf2 are array parameters, i.e.
> constants.  The error complains that the initialization
> is not static.  I have other similar statements in which
> I use ceil, arithmetic, etc..., but all with constant
> arguments.
> 
> In my opinion, the result of all these math functions
> should be constants, since the arguments are also all
> constant.  Is this allowed according to the LRM?  Is
> this a compiler bug?
> 
> Thanks,
> 
> Arpad
Received on Mon Nov 14 09:11:03 2005

This archive was generated by hypermail 2.1.8 : Mon Nov 14 2005 - 09:11:08 PST