From: Alan T. DeKok Date: Tue, 19 Dec 2023 01:14:10 +0000 (-0500) Subject: add notes on automatic casting X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9eef994910909115788da34256a37ecb95e4d568;p=thirdparty%2Ffreeradius-server.git add notes on automatic casting --- diff --git a/doc/antora/modules/reference/pages/unlang/condition/cmp.adoc b/doc/antora/modules/reference/pages/unlang/condition/cmp.adoc index 8fe818580e3..8bc778aacff 100644 --- a/doc/antora/modules/reference/pages/unlang/condition/cmp.adoc +++ b/doc/antora/modules/reference/pages/unlang/condition/cmp.adoc @@ -36,6 +36,8 @@ only exceptions are the xref:unlang/condition/regex.adoc[regular expression] ope which interpret the `lhs` as a printable string, and the `rhs` as a regular expression. +Comparisons can be done across differing data types. Comparng a `uint8` value to an `uint16` value will "just work", as the data types will be automatically converted before any comparison is done. + == IP Address Comparisons The type-specific comparisons operate as expected for most data types. diff --git a/doc/antora/modules/reference/pages/unlang/edit.adoc b/doc/antora/modules/reference/pages/unlang/edit.adoc index f7c84a2e75e..a25721238f0 100644 --- a/doc/antora/modules/reference/pages/unlang/edit.adoc +++ b/doc/antora/modules/reference/pages/unlang/edit.adoc @@ -395,6 +395,8 @@ Similarly, subtracting two 'ipv4addr' data types results in a numerical value. Adding a `time_delta` or `integer` to a `date` will result in a `date`. +Similarly, assignments and/or modifications can be done across differing data types. Adding a `uint8` value to an `uint16` value will "just work", as the data types will be automatically converted before assignments or operations are done. + === Operations on `string` and `octet` Data Types The operators also apply to variable-sized values.