Opened 13 years ago

Last modified 13 years ago

#1712 closed defect (invalid)

"sum" error

Reported by: mohamed Owned by: mohamed
Priority: blocker Milestone:
Component: Version:
Keywords: Cc: mohamed,

Description

Hello,

This is a problem whith function sum.

when simulating this model,i have the following error generated.

best regards,
MS

model ps

parameter Real x[4]={1.0,1.1,1.3,1.2};
parameter Real y[4]={2.1,2.2,2.3,2.4};
Real z;
equation
z=sum (x*y);

end ps;

Error: Error building simulator. Buildlog: gcc -O3 -falign-functions -msse2 -mfpmath=sse -I\"C:/OpenModelica1.8.1//include/omc\" -I. -c -o ps.o ps.c
ps.c: In function 'eqFunction_10633':
ps.c:166: error: lvalue required as unary '&' operand
mingw32-make: * [ps.o] Error 1

Change History (1)

comment:1 by Martin Sjölund, 13 years ago

Thanks for the bug, but sum(scalar) is not a valid expression. I will add a compiler error for this. You should simply use x*y in this code.

Note: See TracTickets for help on using tickets.