You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the native range checking should be enough in Free Pascal, without affecting the whole thing:
Remark The standard functions val and Read will also check ranges when the call is compiled in {$R+} mode.
In Delphi, range checking is only switchable at the procedure level. In Free Pascal, the {$R } directive can be used at the expression level.
The OpenDSS parser uses the Val function, e.g.
dss_capi/src/Parser/ParserDel.pas
Line 792 in 0ef72db
Most integers in OpenDSS are 32-bit values. If the input is larger than the max value, the value is truncated (upper bits dropped).
The results in DSS C-API are the same as in the official binaries, but we could add optional error messages to warn of this behavior.
Since the values are truncated instead of clipped to max/min, this can be dangerous.
Low priority.
The text was updated successfully, but these errors were encountered: