diff --git a/RELEASENOTES-1.4.docu b/RELEASENOTES-1.4.docu
index bb3e60c8e..74cd41f11 100644
--- a/RELEASENOTES-1.4.docu
+++ b/RELEASENOTES-1.4.docu
@@ -445,7 +445,7 @@
for huge (multi-megabyte) struct types
.
--coverity has been added as an
- option to DMLC. When used, DMLC will generate Synopsys® Coverity® analysis
+ option to DMLC. When used, DMLC will generate Synopsys* Coverity* analysis
annotations to suppress common false positives in generated C code created
from DML 1.4 devices.
Fixed an ICE caused by constant inlined
diff --git a/RELEASENOTES.docu b/RELEASENOTES.docu
index 437ed5758..fe63880e5 100644
--- a/RELEASENOTES.docu
+++ b/RELEASENOTES.docu
@@ -1536,7 +1536,7 @@
Adjusted DMLC code generation to silence
false positives
reported on dml-builtins.dml when analysing
- DMLC-generated C code using the Synopsis® Coverity®
+ DMLC-generated C code using the Synopsys* Coverity*
static analysis tool.
Improved some error messages .
diff --git a/doc/1.4/running-dmlc.md b/doc/1.4/running-dmlc.md
index 160890dae..0c1862351 100644
--- a/doc/1.4/running-dmlc.md
+++ b/doc/1.4/running-dmlc.md
@@ -113,7 +113,7 @@ causes generated C code to follow the DML code more closely.
--coverity
-Adds Synopsys® Coverity® analysis annotations to suppress common false positives
+Adds Synopsys* Coverity* analysis annotations to suppress common false positives
in generated C code created from DML 1.4 device models.
diff --git a/md_to_github.py b/md_to_github.py
index 73610fcb9..0c7c3f47b 100644
--- a/md_to_github.py
+++ b/md_to_github.py
@@ -53,6 +53,11 @@ def toc_md_files(toc, indices):
-->
'''
+acknowledgement = r'''
+***
+\* Other names and brands may be claimed as the property of others.
+'''
+
frontpage_links = []
filename_map = {}
@@ -93,6 +98,9 @@ def add_to_tar(tf, path, contents):
end = match.end(1)
if end > start:
body = body[:start] + filename_map[match[1]] + body[end:]
+
+ if validate_md_links.third_party_trademark_re.search(body) is not None:
+ body += acknowledgement
add_to_tar(tgz, path, copyright + body)
head = [copyright,
diff --git a/py/dml/dmlc.py b/py/dml/dmlc.py
index c953f5c17..38d63a19e 100644
--- a/py/dml/dmlc.py
+++ b/py/dml/dmlc.py
@@ -374,12 +374,12 @@ def set_debuggable(option, opt, value, parser):
+ ' --strict-dml12.')
# --coverity
- # Adds Synopsys® Coverity® analysis annotations to suppress common
+ # Adds Synopsys* Coverity* analysis annotations to suppress common
# false positives in generated C code created from DML 1.4 device models.
#
optpar.add_option(
'--coverity', dest = 'coverity', action = 'store_true',
- help = ('Adds Synopsys® Coverity® analysis annotations to suppress '
+ help = ('Adds Synopsys* Coverity* analysis annotations to suppress '
+ 'common false positives in generated C code created from '
+ 'DML 1.4 device models.'))
# --noline
diff --git a/validate_md_links.py b/validate_md_links.py
index 91c11d9b4..ee849b653 100644
--- a/validate_md_links.py
+++ b/validate_md_links.py
@@ -24,6 +24,12 @@ def toc_md_files(toc, dirs):
assert anchor_re.findall('') == ['comparison-to-c']
+third_party_trademarks = {'synopsys', 'coverity'}
+
+third_party_trademark_re = re.compile(
+ r'(?i:(' + '|'.join(third_party_trademarks)
+ + r'))([*®™]|®|™|©|\\\*)?')
+
def char_range(low, high):
return map(chr, range(ord(low), ord(high) + 1))
@@ -95,11 +101,40 @@ def main():
line = md_files[path][:match.start()].count('\n') + 1
sys.stderr.write(f'{path}:{line}: error: {message}\n')
ok = False
+
+ third_party_trademarks_referenced = {}
+ third_party_trademarks_annotated = set()
+ def check_third_party_trademarks():
+ for (tm, line) in third_party_trademarks_referenced.items():
+ if tm not in third_party_trademarks_annotated:
+ sys.stderr.write(
+ f"{path}:{line+1}: error: third party trademark "
+ + f"'{tm}' never annotated with '*' in this section\n")
+ nonlocal ok
+ ok = False
+ third_party_trademarks_referenced.clear()
+ third_party_trademarks_annotated.clear()
+
for (i, line) in enumerate(md_files[path].split('\n')):
if ' -- ' in f' {line} ':
sys.stderr.write(
f'{path}:{i+1}: error: replace -- with —\n')
ok = False
+
+ # A third party trademark must be annotated at least once per
+ # (sub)section
+ if line.startswith('#'):
+ check_third_party_trademarks()
+ for match in third_party_trademark_re.finditer(line):
+ annotated = match.group(2) in {'*', '\\*'}
+
+ tm = match.group(1).lower()
+ third_party_trademarks_referenced.setdefault(tm, i)
+ if annotated:
+ third_party_trademarks_annotated.add(tm)
+
+ check_third_party_trademarks()
+
sys.exit(0 if ok else 1)
if __name__ == '__main__':