Skip to content

Commit 3b8beb7

Browse files
committed
Polished documentation for some warnings
1 parent 7ecdbc9 commit 3b8beb7

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

py/dml/messages.py

+13-11
Original file line numberDiff line numberDiff line change
@@ -1893,10 +1893,11 @@ def log(self):
18931893
class WNOVER(DMLWarning):
18941894
"""
18951895
A DML file must start with a version statement, such as `dml 1.4;`
1896-
"""
1897-
fmt = "file has no version tag, assuming version 1.2"
18981896
1897+
This warning becomes an error in Simics API 8 and newer, when the
1898+
compatibility feature `optional_version_statement` is disabled.
18991899
"""
1900+
fmt = "file has no version tag, assuming version 1.2"
19001901

19011902
class WNDOCRA(DMLWarning):
19021903
"""
@@ -1916,10 +1917,11 @@ class WNEGOFFS(DMLWarning):
19161917

19171918
class WUNUSEDDEFAULT(DMLWarning):
19181919
"""
1919-
The object is not referenced anywhere but it matches a name of an
1920-
object automatically referenced in another scope. This is the same
1921-
as WUNUSED but only for known common errors and it will never be
1922-
emitted if WUNUSED is enabled.
1920+
In DML 1.2, it is usually a mistake to implement a method named
1921+
`after_write` in a field, because only register objects recognize that
1922+
method. The `WUNUSEDDEFAULT` warning captures this kind of mistake
1923+
by reporting a warning when a method is implemented that is unused,
1924+
but whose name matches a method commonly implemented in other objects.
19231925
"""
19241926
fmt = "unused: %s methods are not called automatically for %s objects in %s"
19251927
def __init__(self, obj):
@@ -1945,11 +1947,11 @@ class WUNUSED_DML12(DMLWarning):
19451947
def __init__(self, obj):
19461948
DMLWarning.__init__(self, obj, obj.name)
19471949

1948-
19491950
class WSIZEOFTYPE(DMLWarning):
19501951
"""
1951-
The 'sizeof' operator is used on a type name, but expects an
1952-
expression. Use the 'sizeoftype' operator for types.
1952+
In DML 1.4 it is an error to pass a type name as the operand of `sizeof`.
1953+
In DML 1.2 it instead emits a `WSIZEOFTYPE` warning, for legacy reasons.
1954+
To get the size of a type, the `sizeoftype` operator should be used.
19531955
"""
19541956
fmt = "sizeof on a type is not legal, use sizeoftype instead"
19551957

@@ -2007,8 +2009,8 @@ class WWRNSTMT(DMLWarning):
20072009
class WREF(DMLWarning):
20082010
"""An unused parameter refers to an object that has not been declared.
20092011
2010-
This warning message will be replaced with a hard error in future
2011-
major versions of Simics.
2012+
This warning message is replaced with a hard error for modules compiled
2013+
with Simcis API 6 or newer.
20122014
"""
20132015
instances = []
20142016
fmt = "unused parameter %s contains %s"

0 commit comments

Comments
 (0)