Opened 12 years ago

Closed 12 years ago

Last modified 9 years ago

#1803 closed enhancement (invalid)

check for constant expressions while compiling omc

Reported by: Jens Frenkel Owned by: Martin Sjölund
Priority: high Milestone: never
Component: MetaModelica Version: trunk
Keywords: warnings Cc: Adrian Pop

Description

when compiling omc the bootsrapped compiler should be checking for statements like
a = b-b;
and report a warning
"Warning: constant assignment for a = b-b = 0;"


Change History (5)

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

We do things like lst = {} to initialize a list all the time... The same error would also occur for regular Modelica users where things like inheritance may cause expressions to be constant.

Are you sure you want that warning?

comment:2 by Jens Frenkel, 12 years ago

10 minutes ago I found a bug in omc. This bug could be avoided if a warning is reported.

expandsize = size1-size1;
->
expandsize = size1-size;

With this bugfix omc is now able to compile the multibody pendulum with more than 200 bodies. Before he crached by 33.

comment:3 by Martin Sjölund, 12 years ago

Still, most expressions assigned are constant, so I think this should not be a warning as it is legal code, and often what the programmer intended to write.

comment:4 by Martin Sjölund, 12 years ago

Resolution: invalid
Status: newclosed

comment:5 by Dietmar Winkler, 9 years ago

Milestone: Futurenever

Sorting away the closed as invalid, won't fix and duplicate tickets from Future.

Note: See TracTickets for help on using tickets.