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
FUNCTION fn_int : INTVAR_INPUT {ref}
in_ref : INT;
END_VARVAR_IN_OUT
in_out : INT;
END_VAREND_FUNCTIONPROGRAM main
VAR
var1_lint, var2_lint : LINT:=4;
END_VAR
fn_int(var1_lint, var2_lint);
END_PROGRAM
Rusty currently does not generate any warnings although the arguments are incompatible with the function signature. Once issue #698 is implemented, whether it's going to be in the form of a bitcast[1] or a truncate instruction, potential data-loss might be involved. Thus it would be nice if some warnings are generated for the end-user. For reference, clang generates something along
warning: incompatible pointer types passing 'long *' to parameter of type 'int *' [-Wincompatible-pointer-types]
[1] as it is implemented in the current PR where the IR looks similar to its C counter-part, i.e.
The text was updated successfully, but these errors were encountered:
volsa
changed the title
Generate warnings when a downcast is involved in a function call
Generate warnings if a downcast is involved in a function call
Jan 13, 2023
Given the following code snippet
Rusty currently does not generate any warnings although the arguments are incompatible with the function signature. Once issue #698 is implemented, whether it's going to be in the form of a bitcast[1] or a truncate instruction, potential data-loss might be involved. Thus it would be nice if some warnings are generated for the end-user. For reference,
clang
generates something along[1] as it is implemented in the current PR where the IR looks similar to its C counter-part, i.e.
The text was updated successfully, but these errors were encountered: