Skip to content

Commit b75535f

Browse files
committed
Add comment in component_with_printf example
1 parent dc7a784 commit b75535f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

component-model/examples/tutorial/c/adder/component_with_printf.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
uint32_t exports_docs_adder_add_add(uint32_t x, uint32_t y)
55
{
66
uint32_t result = x + y;
7+
// On traditional platforms, printf() prints to stdout, but on Wasm platforms,
8+
// stdout and the idea of printing to an output stream is
9+
// introduced and managed by WASI.
10+
//
11+
// When building this code with wasi-libc (as a part of wasi-sdk), the printf call
12+
// below is implemented with code that uses `wasi:cli/stdout` and `wasi:io/streams`.
713
printf("%d", result);
814
return result;
915
}

0 commit comments

Comments
 (0)