Skip to content

Allow macros that shadow mldsa-native functions#305

Open
bensze01 wants to merge 1 commit into
Mbed-TLS:mainfrom
bensze01:mldsa-buffer-alloc
Open

Allow macros that shadow mldsa-native functions#305
bensze01 wants to merge 1 commit into
Mbed-TLS:mainfrom
bensze01:mldsa-buffer-alloc

Conversation

@bensze01
Copy link
Copy Markdown
Contributor

@bensze01 bensze01 commented May 18, 2026

Description

check_names.py normally requires uppercase macro names. Make an exception for helper macros that shadow the functions names used by mldsa-native.

PR checklist

check_names.py normally requires uppercase macro names. Make an
exception for helper macros that shadow the functions names used by
mldsa-native.

Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
@bensze01 bensze01 added enhancement New feature or request priority-high High priority - will be reviewed soon size-xs Estimated task size: extra small (a few hours at most) labels May 18, 2026
Copy link
Copy Markdown
Contributor

@gilles-peskine-arm gilles-peskine-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok in principle, but can we make the exception more specific?

Comment thread scripts/check_names.py
# platforms that claim single-uppercase-letter names for themselves).
INTERNAL_MACRO_PATTERN = re.compile("^[A-Z][0-9A-Z_]*[A-Z0-9]$")
#
# We make an exception for the helper macros that shadow the functions
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to make the exception more specific and do it via to name_pattern_exception. Is there a reason why that wouldn't work?

Copy link
Copy Markdown

@bjwtaylor bjwtaylor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good except for the issue Gilles pointed out, the commit message also has a grammatical error “functions names” should be “function names”

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request priority-high High priority - will be reviewed soon size-xs Estimated task size: extra small (a few hours at most)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants