-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error codes: enforce add macro #9566
Error codes: enforce add macro #9566
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have reviewed the script in the commit message and executed it locally arriving at the same result. I have reviewed the last two commits manually.
Looks good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, however will need rebase due to conflicts.
Replace obvious additions of an `MBEDTLS_ERR_xxx` constant by a call to `MBEDTLS_ERROR_ADD`. Skip `case` statements since `MBEDTLS_ERROR_ADD(pp_constant)` is not a preprocessor constant. This commit does not replace additions split over lines. Those will be handled in a subsequent commit. ``` git ls-files '*.h' '*.c' '*.function' '*.data' | xargs perl -i -pe ' next if /\bcase\b/; s/\b(MBEDTLS_ERR_\w+)\s*\+\s*(\w+)\b/MBEDTLS_ERROR_ADD($1, $2)/g; s/\b(\w+)\s*\+\s*(MBEDTLS_ERR_\w+)\b/MBEDTLS_ERROR_ADD($1, $2)/g' ``` Signed-off-by: Gilles Peskine <[email protected]>
Reject direct additions of error constants (regex-based approximation). Fix the lone straggler. Signed-off-by: Gilles Peskine <[email protected]>
Signed-off-by: Gilles Peskine <[email protected]>
84fb57c
to
5255a9e
Compare
I have rebased on top of the latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The failure on the merge queue was a timeout in one test case of |
e1f37c5
Enforce the use of
MBEDTLS_ERROR_ADD
to add a low-level error code with a high-level error code.This is a step of DI towards.#8501.
PR checklist