#1803 closed enhancement (invalid)
check for constant expressions while compiling omc
Reported by: | jfrenkel | Owned by: | sjoelund.se |
---|---|---|---|
Priority: | high | Milestone: | never |
Component: | MetaModelica | Version: | trunk |
Keywords: | warnings | Cc: | adrpo |
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 Changed 12 years ago by sjoelund.se
comment:2 Changed 12 years ago by jfrenkel
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 Changed 12 years ago by sjoelund.se
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 Changed 12 years ago by sjoelund.se
- Resolution set to invalid
- Status changed from new to closed
comment:5 Changed 9 years ago by dietmarw
- Milestone changed from Future to 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?