Opened 12 years ago

Closed 12 years ago

#1871 closed defect (fixed)

The FMI implementation contains int<->pointer casts

Reported by: Per Östlund Owned by: Adeel Asghar
Priority: high Milestone: 1.9.0
Component: Run-time Version: trunk
Keywords: Cc:

Description

The file Compiler/runtime/FMIImpl.c contains a couple of typecasts from pointers to/from ints, which means that pointers will be trunkated on most 64-bit platforms. We should use something like intptr_t instead, or preferably not cast pointers at all. Here's a list of all the places where this is done:

FMIImpl.c: In function ‘FMIImpl__initializeFMIImport’:
FMIImpl.c:319:39: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
FMIImpl.c: In function ‘FMIImpl__releaseFMIImport’:
FMIImpl.c:367:8: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
FMIImpl.c:368:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
FMIImpl.c:371:27: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
FMIImpl.c: In function ‘FMIImpl__getFMIModelVariableVariability’:
FMIImpl.c:379:38: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
FMIImpl.c: In function ‘FMIImpl__getFMIModelVariableCausality’:
FMIImpl.c:387:36: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
FMIImpl.c: In function ‘FMIImpl__getFMIModelVariableBaseType’:
FMIImpl.c:395:35: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
FMIImpl.c: In function ‘FMIImpl__getFMIModelVariableName’:
FMIImpl.c:403:31: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
FMIImpl.c: In function ‘FMIImpl__getFMIModelVariableDescription’:
FMIImpl.c:411:47: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
FMIImpl.c: In function ‘FMIImpl__getFMINumberOfContinuousStates’:
FMIImpl.c:419:54: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
FMIImpl.c: In function ‘FMIImpl__getFMINumberOfEventIndicators’:
FMIImpl.c:427:53: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
FMIImpl.c: In function ‘FMIImpl__getFMIModelVariableHasStart’:
FMIImpl.c:435:45: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
FMIImpl.c: In function ‘FMIImpl__getFMIModelVariableIsFixed’:
FMIImpl.c:443:44: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
FMIImpl.c: In function ‘FMIImpl__getFMIRealVariableStartValue’:
FMIImpl.c:451:88: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
FMIImpl.c: In function ‘FMIImpl__getFMIIntegerVariableStartValue’:
FMIImpl.c:463:97: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
FMIImpl.c: In function ‘FMIImpl__getFMIBooleanVariableStartValue’:
FMIImpl.c:475:94: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
FMIImpl.c: In function ‘FMIImpl__getFMIStringVariableStartValue’:
FMIImpl.c:487:94: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
FMIImpl.c: In function ‘FMIImpl__getFMIEnumerationVariableStartValue’:
FMIImpl.c:499:96: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

Change History (1)

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

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.