aboutsummaryrefslogtreecommitdiffstats
path: root/doc/gawk.texi
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2015-02-01 20:53:05 +0200
committerArnold D. Robbins <arnold@skeeve.com>2015-02-01 20:53:05 +0200
commitbcb51623b8e156b03c2ae588906e4ed25fa3eba2 (patch)
treef693983ab1daea9761135dae96be0f515b29f681 /doc/gawk.texi
parent1bd1b885c7dd16b5e4ab78c040312f6f7d742784 (diff)
downloadegawk-bcb51623b8e156b03c2ae588906e4ed25fa3eba2.tar.gz
egawk-bcb51623b8e156b03c2ae588906e4ed25fa3eba2.tar.bz2
egawk-bcb51623b8e156b03c2ae588906e4ed25fa3eba2.zip
Move param checking against function names into --posix.
Diffstat (limited to 'doc/gawk.texi')
-rw-r--r--doc/gawk.texi12
1 files changed, 8 insertions, 4 deletions
diff --git a/doc/gawk.texi b/doc/gawk.texi
index df5afc63..7e8d93de 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -19342,8 +19342,12 @@ According to the POSIX standard, function parameters
cannot have the same name as one of the special predefined variables
(@pxref{Built-in Variables}), nor may a function parameter have the
same name as another function.
+
Not all versions of @command{awk} enforce
these restrictions.
+@command{gawk} always enforces the first restriction.
+With @option{--posix} (@pxref{Options}),
+it also enforces the second restriction.
@end quotation
Local variables act like the empty string if referenced where a string
@@ -20061,13 +20065,13 @@ using indirect function calls:
@c file eg/prog/indirectcall.awk
# average --- return the average of the values in fields $first - $last
-function average(first, last, the_sum, i)
+function average(first, last, sum, i)
@{
- the_sum = 0;
+ sum = 0;
for (i = first; i <= last; i++)
- the_sum += $i
+ sum += $i
- return the_sum / (last - first + 1)
+ return sum / (last - first + 1)
@}
# sum --- return the sum of the values in fields $first - $last