Bug 752257 - If you set PROCINFO["sorted_in"]="@str_ind_asc" (as described in the info file) a "function not found" error is generated
Summary: If you set PROCINFO["sorted_in"]="@str_ind_asc" (as described in the info fi...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: 0xFFFF
Version: 16
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: David Woodhouse
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-11-08 23:34 UTC by Peter Trenholme
Modified: 2012-06-06 09:29 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-06-06 09:29:12 UTC
Type: ---


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.