Bug 752257

Summary: If you set PROCINFO["sorted_in"]="@str_ind_asc" (as described in the info file) a "function not found" error is generated
Product: [Fedora] Fedora Reporter: Peter Trenholme <PTrenholme>
Component: 0xFFFFAssignee: David Woodhouse <dwmw2>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 16CC: dwmw2, mbriza, vvitek
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-06 09:29:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Peter Trenholme 2011-11-08 23:34:54 UTC
Description of problem:
Section 11.2.1.2 describes a method of controlling the order in which the index values will be returned by the "for (index in array)" statement. Using the example in the info file throws a load error that the function is not found. 

Version-Release number of selected component (if applicable):
4.0.0

How reproducible:
Every time

Steps to Reproduce:
1. Write a program using the PROCINFO["sorted_in"]="str_ind_asc" statement
2. Attempt to run it
3.
  
Actual results:
$ gawk 'BEGIN {PROCINFO["sorted_in"]="@str_ind_asc";a[1]=1;a[2]=-1;for (i in a) print a[i]}'
gawk: cmd. line:1: fatal: sort comparison function `@str_ind_asc' is not defined

Expected results:
Successful run

Additional info:
Creating my own function, per 11.2.1.1, works with no problem.

Comment 1 Martin Bříza 2012-06-06 09:29:12 UTC
Hello,

first: sorry for answering your report this late.
The "problem" here is in the fact there was a typo in the documentation of that function. It is spelled "ind_str_asc". It is now fixed even in the docs: http://www.gnu.org/software/gawk/manual/html_node/Controlling-Scanning .

Thank you for reporting, I'm closing this for now. But feel free to reopen if needed.