Blame POSIX.STD

Packit Service f629e6
  Copyright (C) 1992, 1995, 1998, 2001, 2006, 2007, 2010, 2011, 2015
Packit Service f629e6
  Free Software Foundation, Inc.
Packit Service f629e6
  
Packit Service f629e6
  Copying and distribution of this file, with or without modification,
Packit Service f629e6
  are permitted in any medium without royalty provided the copyright
Packit Service f629e6
  notice and this notice are preserved.
Packit Service f629e6
--------------------------------------------------------------------------
Packit Service f629e6
Thu Feb 12 08:51:22 IST 2015
Packit Service f629e6
============================
Packit Service f629e6
This file documents several things related to the 2008 POSIX standard
Packit Service f629e6
that I noted after reviewing it.
Packit Service f629e6
Packit Service f629e6
1. POSIX leaves undefined what happens for something like
Packit Service f629e6
Packit Service f629e6
	awk '{ print ; exit }' if=42 /etc/passwd
Packit Service f629e6
Packit Service f629e6
   Mawk diagnoses this.  Gawk and BWK awk do not. This doesn't seem to be
Packit Service f629e6
   worth the effort to add the code, but at least I'm aware of it.
Packit Service f629e6
Packit Service f629e6
2. The 2001-2004 standards accidentally required support for hexadecimal
Packit Service f629e6
   floating point constants and for Infinity and Not-A-Number (NaN) values.
Packit Service f629e6
Packit Service f629e6
   The 2008 standard now explicitly allows, but does not require, such
Packit Service f629e6
   support.
Packit Service f629e6
Packit Service f629e6
   More discussion is provided in the node `POSIX Floating Point Problems'
Packit Service f629e6
   in gawk.texi.
Packit Service f629e6
Packit Service f629e6
3. String comparison with <, <= etc is supposed to take the locale's collating
Packit Service f629e6
   sequence into account.  By default gawk doesn't do this. Rather, gawk
Packit Service f629e6
   will do this only if --posix is in effect.
Packit Service f629e6
Packit Service f629e6
4. According to POSIX, the function parameters of one function may not have
Packit Service f629e6
   the same name as another function, making this invalid:
Packit Service f629e6
Packit Service f629e6
	function foo() { ... }
Packit Service f629e6
	function bar(foo) { ...}
Packit Service f629e6
Packit Service f629e6
   Or even:
Packit Service f629e6
Packit Service f629e6
	function bar(foo) { ...}
Packit Service f629e6
	function foo() { ... }
Packit Service f629e6
Packit Service f629e6
   Gawk enforces this only with --posix.
Packit Service f629e6
Packit Service f629e6
The following things aren't described by POSIX but ought to be:
Packit Service f629e6
Packit Service f629e6
1. The value of $0 in an END rule
Packit Service f629e6
Packit Service f629e6
2. The return value of a function that either does return with no value
Packit Service f629e6
   or that falls off the end of the function body.
Packit Service f629e6
Packit Service f629e6
3. What happens with substr() if start is <= 0, or greater than the length
Packit Service f629e6
   of the string, or if length is <= 0.
Packit Service f629e6
Packit Service f629e6
4. Whether "next" can be invoked from a function body.