Skip to content

-fstack-usage prints incorrect source file names #69889

@sinelaw

Description

@sinelaw

Instead of printing include file names, it always prints the main source file names. This is inconsistent with gcc and makes the output ambiguous.

// test.inc:
void foo(void); void foo(void) { }

// test.c:
#include "test.inc"

gcc:

echo 'void foo(void); void foo(void) { }' > test.inc && echo '#include "test.inc"' > test.c && gcc -fstack-usage -c test.c -o test.o && cat test.su

output: test.inc:1:22:foo 16 static

clang:

echo 'void foo(void); void foo(void) { }' > test.inc && echo '#include "test.inc"' > test.c && clang-15 -fstack-usage -c test.c -o test.o && cat test.su

output: test.c:1:foo 8 static

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions