Opened 7 years ago
Closed 7 years ago
#4571 closed defect (fixed)
MetaModelica function pointer with underscore generates invalid code
Reported by: | Per Östlund | Owned by: | Martin Sjölund |
---|---|---|---|
Priority: | normal | Milestone: | 1.13.0 |
Component: | MetaModelica | Version: | v1.13.0-dev-nightly |
Keywords: | Cc: |
Description
A MetaModelica function pointer that has an underscore in its name causes the code generation to expand the underscore to __ when using the function, but not when declaring it. For example:
partial function pf end pf; pf fu_nc = f; algorithm fu_nc();
generates the following C-code (note _fu_nc on first lines and _fu__nc on last):
modelica_fnptr _fu_nc; MMC_SO(); _tailrecursive: OMC_LABEL_UNUSED _fu_nc = boxvar_f; (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_fu__nc), 2))) ? ((void(*)(threadData_t*, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_fu__nc), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_fu__nc), 2)))) : ((void(*)(threadData_t*)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_fu__nc), 1)))) (threadData);
Attachments (1)
Change History (3)
by , 7 years ago
comment:1 by , 7 years ago
Milestone: | Future → 1.13.0 |
---|---|
Status: | new → accepted |
comment:2 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
Note:
See TracTickets
for help on using tickets.