Skip to content

Commit f18cc43

Browse files
authored
[doc] Fix format string of printf in @ccall example (#52770)
The format string of the `@ccall` example for `printf` had a `%d` specifier but the argument passed was `"5"::Cstring`, which is also inconsistent with the corresponding `ccall` example.
1 parent b682592 commit f18cc43

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/src/manual/calling-c-and-fortran-code.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,7 @@ A table of translations between the macro and function interfaces is given below
999999
| `@ccall "mylib".f(a::Cint, b::Cdouble)::Cvoid` | `ccall((:f, "mylib"), Cvoid, (Cint, Cdouble), (a, b))` |
10001000
| `@ccall $fptr.f()::Cvoid` | `ccall(fptr, f, Cvoid, ())` |
10011001
| `@ccall printf("%s = %d\n"::Cstring ; "foo"::Cstring, foo::Cint)::Cint` | `<unavailable>` |
1002-
| `@ccall printf("%s = %d\n"::Cstring ; "2 + 2"::Cstring, "5"::Cstring)::Cint` | `ccall(:printf, Cint, (Cstring, Cstring...), "%s = %s\n", "2 + 2", "5")` |
1002+
| `@ccall printf("%s = %s\n"::Cstring ; "2 + 2"::Cstring, "5"::Cstring)::Cint` | `ccall(:printf, Cint, (Cstring, Cstring...), "%s = %s\n", "2 + 2", "5")` |
10031003
| `<unavailable>` | `ccall(:gethostname, stdcall, Int32, (Ptr{UInt8}, UInt32), hn, length(hn))` |
10041004

10051005
## [Calling Convention](@id calling-convention)

0 commit comments

Comments
 (0)