#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 , 12 years ago
comment:2 by , 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 , 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 , 12 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:5 by , 9 years ago
Milestone: | Future → never |
---|
Sorting away the closed as invalid, won't fix and duplicate tickets from Future.
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?