Skip to content

Commit 487049e

Browse files
committed
Add a few missing cast(int) for %.*s printf lengths
musl seems to be sensitive to this on AArch64.
1 parent 158aca0 commit 487049e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

runtime/druntime/src/rt/dwarfeh.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ extern (C) _Unwind_Reason_Code _d_eh_personality_common(_Unwind_Action actions,
564564
{
565565
auto eh = ExceptionHeader.toExceptionHeader(exceptionObject);
566566
for (auto ehx = eh; ehx; ehx = ehx.next)
567-
writeln(" eh: %p next=%014p lsda=%p '%.*s'", ehx, ehx.next, ehx.languageSpecificData, ehx.object.msg.length, ehx.object.msg.ptr);
567+
writeln(" eh: %p next=%014p lsda=%p '%.*s'", ehx, ehx.next, ehx.languageSpecificData, cast(int) ehx.object.msg.length, ehx.object.msg.ptr);
568568
}
569569
}
570570

@@ -657,7 +657,7 @@ extern (C) _Unwind_Reason_Code _d_eh_personality_common(_Unwind_Action actions,
657657
if (exceptionClass == dmdExceptionClass)
658658
{
659659
auto eh = ExceptionHeader.toExceptionHeader(exceptionObject);
660-
debug (EH_personality) writeln(" '%.*s' next = %p", eh.object.msg.length, eh.object.msg.ptr, eh.next);
660+
debug (EH_personality) writeln(" '%.*s' next = %p", cast(int) eh.object.msg.length, eh.object.msg.ptr, eh.next);
661661
auto currentLsd = language_specific_data;
662662
bool bypassed = false;
663663
while (eh.next)

tests/codegen/exception_stack_trace.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ void main()
2121
{
2222
import core.stdc.stdio;
2323
auto s = e.toString();
24-
printf("%.*s\n", s.length, s.ptr);
24+
printf("%.*s\n", cast(int) s.length, s.ptr);
2525
}
2626
}
2727

0 commit comments

Comments
 (0)