-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
2
-
Storage Engines - 2022-12-12
This ticket comes from this conversation.
The packing documentation says the following:
The first character of the format string can be used to indicate the byte order, size and alignment of the packed data
To reproduce the issue apply the following diff:
diff --git a/examples/c/ex_pack.c b/examples/c/ex_pack.c index b0e03114e..1af9af122 100644 --- a/examples/c/ex_pack.c +++ b/examples/c/ex_pack.c @@ -57,7 +57,7 @@ main(int argc, char *argv[]) /* Allocate a bigger buffer. */ } - error_check(wiredtiger_struct_pack(session, buf, size, "iii", 42, 1000, -9)); + error_check(wiredtiger_struct_pack(session, buf, size, ">iii", 42, 1000, -9)); error_check(wiredtiger_struct_unpack(session, buf, size, "iii", &i, &j, &k)); /*! [packing] */
And then execute the ex_pack.c test after compiling the changes:
> ~/wiredtiger/build/examples/c/ex_pack$ pwd /home/ubuntu/wiredtiger/build/examples/c/ex_pack > ./ex_pack