From e42686dc63e0e470c7dd1194eb2b32ea5f83f97b Mon Sep 17 00:00:00 2001 From: overflowerror Date: Sat, 22 May 2021 12:43:41 +0200 Subject: [PATCH] added note about side effects on pointer parameters to readme --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fc8d699..cf4baa4 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ The parameter block has the following syntax: {$ [parameter list ] $} ``` -The parameter list is comma-seperated list of the parameters of the template including their type. +The parameter list is comma-seperated list of the parameters of the template including their type. Example: ``` @@ -47,6 +47,8 @@ Example: Note: All types that C does not provide by default have to be declared in a statement block in the meta section or in a header file included by a statement block in the meta section. In the example above this would apply to the type `user_t`. +Note: In case of pointer parameters they are not allowed to be modified in statement or output blocks. If the template has side effects like that, the behavior might be undefined (because of the calculation of the the output size). + ### Statement Block Statement blocks have the following syntax: @@ -86,7 +88,7 @@ Output blocks have the following syntax: {{ [format string] {, format parameters} }} ``` -These blocks are effectively `printf()`-calls. In the rendered templated they will be replaced by the corresponding output. +These blocks are effectively `printf()`-calls. In the rendered templated they will be replaced by the corresponding output. Example: ```