Skip to content
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

Build option to print file basename only (s2n_strerror_debug) #4211

Closed
wants to merge 1 commit into from

Conversation

ma-ilsi
Copy link

@ma-ilsi ma-ilsi commented Sep 20, 2023

Resolved issues:

Resolves #4208.

Description of changes:

Changes to the build scripts and error/s2n_errno.h introduce the addition of a build option which enables debug output to only print the file basename instead of the absolute path.

No changes have been made to the client-facing API.

Call-outs:

__FILE_NAME__ macro is available in clang since 9.0.0, see the release note. Current clang version is 17.0.1.
__FILE_NAME__ macro is available in gcc since GCC 12, see comments 10 & 13. Current gcc version is 13.2.

The error/s2n_errno.h checks if __FILE_NAME__ macro is defined, otherwise defaults to behaviour of full path output.

Testing:

Local build and tests on Ubuntu succeed. All current tests pass with the S2N_DEBUG_OUTPUT_FILENAME flag both ON and OFF. No new tests added by me for this flag, though.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Adding a build flag to allow having debug output print basename of the file instead of absolute path.
@ma-ilsi ma-ilsi changed the title Build time option to print file basename only (s2n_strerror_debug) Build option to print file basename only (s2n_strerror_debug) Sep 20, 2023
@camshaft
Copy link
Contributor

I think I prefer #4209 instead of a build-time option. Only supporting newer compilers for this functionality is less than ideal.

@ma-ilsi ma-ilsi closed this Sep 21, 2023
@ma-ilsi ma-ilsi deleted the debug_output_filename branch September 21, 2023 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow s2n_strerror_debug output without unecessary filepath prefixed
2 participants