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

src/Gtrace: remove unguarded print() calls #483

Merged
merged 1 commit into from
Mar 27, 2023

Conversation

rossburton
Copy link
Contributor

There is a use of printf() without #include stdio.h in src/arm/Gtrace.c, which results in a compiler error if clang 16 is used:

src/arm/Gtrace.c:529:7: error: call to undeclared library function 'printf' with type 'int (const char *, ...)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

Replace the printf("XXX") with a Dprintf, so it doesn't pull stdio in unless in a debug build, and reword the message to be clearer.

Also tehre is another printf("XXX") inside a FreeBSD-specific block in the UNW_ARM_FRAME_SIGRETURN case, replace this with a #error as the code needs to be implemented.

Fixes #482.

There is a use of printf() without #include stdio.h in src/arm/Gtrace.c,
which results in a compiler error if clang 16 is used:

src/arm/Gtrace.c:529:7: error: call to undeclared library function
'printf' with type 'int (const char *, ...)'; ISO C99 and later do not
support implicit function declarations [-Wimplicit-function-declaration]

Replace the printf("XXX") with a Dprintf, so it doesn't pull stdio in
unless in a debug build, and reword the message to be clearer.

Also there is another printf("XXX") inside a FreeBSD-specific block in
the UNW_ARM_FRAME_SIGRETURN case, replace this with a #error as the code
needs to be implemented.

Fixes libunwind#482.

Signed-off-by: Ross Burton <ross.burton@arm.com>
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.

libunwind fails to build with clang for arm32
2 participants