Commit 2d475b3
committed
tests/core/msg_queue_print: fully initialize msg for sending
On 8-bit and 16-bit platforms `uint32_t` is wider than `void *`, as
pointers are (typically) only 16 bit in size. This causes output like:
Message queue of thread 2
size: 8 (avail: 8)
* 0: sender: 2, type: 0x0000, content: 2701197312 (0)
* 1: sender: 2, type: 0x0001, content: 2701197313 (0x1)
As seen here, the leading two bytes of `msg.content.value` contain
"random" bits, as those bytes are not explicitly initialized.
This fixes the issue by explicitly initializing the whole `msg_t` via
an initializer list.1 parent dcf4aa5 commit 2d475b3
1 file changed
+8
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| |||
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
58 | | - | |
59 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
60 | 64 | | |
61 | 65 | | |
62 | 66 | | |
| |||
0 commit comments