Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions scripts/check_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -1162,6 +1162,10 @@ def check_symbols_declared_in_header(self) -> int:
return len(problems)

BIGNUM_SHORTHANDS = frozenset(['biH', 'biL', 'ciH', 'ciL'])
PLATFORM_REQUIREMENTS_HACK_MACROS = frozenset([
'__DEPREC',
'__STDC_WANT_LIB_EXT1__',
])
def name_pattern_exception(self, group: str, match: Match) -> bool:
"""Whether the given match is an exception to normal naming patterns.

Expand All @@ -1175,6 +1179,13 @@ def name_pattern_exception(self, group: str, match: Match) -> bool:
'_platform_requirements.h' in match.filename and \
re.match(r'_[A-Z_]', match.name):
return True
# There are additional hacks in tf_psa_crypto_common.h (currently,
# specifically for the sake of IAR) around platform requirement
# macros that can't go in the intended header.
if group == 'internal_macros' and \
match.filename.endswith('/tf_psa_crypto_common.h') and \
match.name in self.PLATFORM_REQUIREMENTS_HACK_MACROS:
return True
# We use some short macros that start with a lowercase letter
# internally in bignum code. They are grandfathered in. They
# may be in a header file, but only in a source directory, not
Expand Down