Attribut 'suppress_wrn_C0410'
Für die Compiler-Warnung mit der ID C0410 muss nicht das Pragma 'warning disable', sondern das Attribut 'suppress_wrn_C0410' verwendet werden.
Syntax: {attribute 'suppress_wrn_C0410'}
Beispiel:
Compiler-Warnung für eine Eigenschaft:
C0410: COMPATIBILITY WARNING: A write access to a Property of type REFERENCE calls the SET-Accessor for versions < 3.1.4022.0 and writes the reference, but calls the GET-Accessor for versions >= 3.1.4022.0 and writes the value! Use the operator REF= if you want to assign the reference.
Das Attribut auf eine Eigenschaft anwenden:
{attribute 'suppress_wrn_C0410'}
PROPERTY refSample : REFERENCE TO BOOL
Aufgrund des Attributs wird für die Eigenschaft refSample die Warnung C0410 nicht erzeugt.
![]() | Ab TwinCAT 3.1 Build 4026 ersetzt die Compiler-Warnung mit der ID C5410 die Compiler-Warnung C0410. C5410 ist standardmäßig in den SPS-Projekteigenschaften für das gesamte Projekt deaktiviert. Für einzelne Eigenschaften können Sie die Warnung sowohl mit dem Pragma 'warning disable' als auch mit dem Attribut 'suppress_wrn_C0410' deaktivieren. |