man: clarify that we decode D-Bus bools as "int", not as C99 "bool"

Fixes: #14643
This commit is contained in:
Lennart Poettering 2020-01-28 16:31:40 +01:00
parent e5667705fa
commit 10c238b2cc
2 changed files with 9 additions and 1 deletions

View File

@ -174,6 +174,14 @@ int64_t x;
sd_bus_message_read(m, "x", &amp;x);</programlisting>
<para>Read a boolean value:</para>
<programlisting>sd_bus_message *m;
int x; /* Do not use C99 'bool' type here, it's typically smaller
in memory and would cause memory corruption */
sd_bus_message_read(m, "b", &amp;x);</programlisting>
<para>Read all types of integers:</para>
<programlisting>uint8_t y;

View File

@ -93,7 +93,7 @@
<entry><literal>b</literal></entry>
<entry><constant>SD_BUS_TYPE_BOOLEAN</constant></entry>
<entry>boolean</entry>
<entry><type>int *</type></entry>
<entry><type>int *</type> (NB: not <type>bool *</type>)</entry>
</row>
<row>