Skip to content

Commit

Permalink
[doc] Fix format string of printf in @ccall example (#52770)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
giordano authored Jan 6, 2024
1 parent b682592 commit f18cc43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/src/manual/calling-c-and-fortran-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ A table of translations between the macro and function interfaces is given below
| `@ccall "mylib".f(a::Cint, b::Cdouble)::Cvoid` | `ccall((:f, "mylib"), Cvoid, (Cint, Cdouble), (a, b))` |
| `@ccall $fptr.f()::Cvoid` | `ccall(fptr, f, Cvoid, ())` |
| `@ccall printf("%s = %d\n"::Cstring ; "foo"::Cstring, foo::Cint)::Cint` | `<unavailable>` |
| `@ccall printf("%s = %d\n"::Cstring ; "2 + 2"::Cstring, "5"::Cstring)::Cint` | `ccall(:printf, Cint, (Cstring, Cstring...), "%s = %s\n", "2 + 2", "5")` |
| `@ccall printf("%s = %s\n"::Cstring ; "2 + 2"::Cstring, "5"::Cstring)::Cint` | `ccall(:printf, Cint, (Cstring, Cstring...), "%s = %s\n", "2 + 2", "5")` |
| `<unavailable>` | `ccall(:gethostname, stdcall, Int32, (Ptr{UInt8}, UInt32), hn, length(hn))` |

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

0 comments on commit f18cc43

Please sign in to comment.