aboutsummaryrefslogtreecommitdiff
path: root/docs/migration.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/migration.rst')
-rw-r--r--docs/migration.rst35
1 files changed, 34 insertions, 1 deletions
diff --git a/docs/migration.rst b/docs/migration.rst
index fdc1d8c..d358600 100644
--- a/docs/migration.rst
+++ b/docs/migration.rst
@@ -11,7 +11,40 @@ are included, in order to make it easier to find this document.
.. contents ::
-Nanopb-0.3.9.1, 0.4.0 (2018-xx-xx)
+Nanopb-0.3.9.4, 0.4.0 (2019-xx-xx)
+==================================
+
+Fix generation of min/max defines for enum types
+------------------------------------------------
+
+**Rationale:** Nanopb generator makes #defines for enum minimum and maximum
+value. Previously these defines incorrectly had the first and last enum value,
+instead of the actual minimum and maximum. (issue #405)
+
+**Changes:** Minimum define now always has the smallest value, and maximum
+define always has the largest value.
+
+**Required actions:** If these defines are used and enum values in .proto file
+are not defined in ascending order, user code behaviour may change. Check that
+user code doesn't expect the old, incorrect first/last behaviour.
+
+Fix undefined behavior related to bool fields
+---------------------------------------------
+
+**Rationale:** In C99, `bool` variables are not allowed to have other values
+than `true` and `false`. Compilers use this fact in optimization, and constructs
+like `int foo = msg.has_field ? 100 : 0` will give unexpected results otherwise.
+Previously nanopb didn't enforce that decoded bool fields had valid values.
+
+**Changes:** Bool fields are now handled separately as `PB_LTYPE_BOOL`. The
+`LTYPE` descriptor numbers for other field types were renumbered.
+
+**Required actions:** Source code files must be recompiled, but regenerating
+`.pb.h`/`.pb.c` files from `.proto` is not required. If user code directly uses
+the nanopb internal field representation (search for `PB_LTYPE_VARINT` in source),
+it may need updating.
+
+Nanopb-0.3.9.1, 0.4.0 (2018-04-14)
==================================
Fix handling of string and bytes default values