Viewing Issue Simple Details
[ Jump to Notes ]
|
[ Issue History ]
[ Print ]
|
ID |
Category |
Severity |
Type |
Date Submitted |
Last Update |
0000383 |
[1003.1(2008)/Issue 7] Shell and Utilities |
Editorial |
Omission |
2011-02-18 23:35 |
2013-04-16 13:06 |
|
Reporter |
jilles |
View Status |
public |
|
Assigned To |
ajosey |
Priority |
normal |
Resolution |
Accepted As Marked |
|
Status |
Closed |
|
|
|
|
Name |
Jilles Tjoelker |
Organization |
|
User Reference |
|
Section |
2.9.5 Function Definition Command |
Page Number |
2324 |
Line Number |
73374-73406 |
Interp Status |
--- |
Final Accepted Text |
Note: 0000692 |
|
Summary |
0000383: function with the same name as a special builtin |
Description |
The command search in 2.9.1.1 means that a function with the same name as a special builtin (such as export) cannot be called.
Section 2.9.5 Function Definition Command allows function definitions to fail with a non-zero exit status but does not specify conditions for this.
It does not really make much sense to me to allow defining a function but not calling it.
In ksh93, trying to define a function with the same name as a special builtin is a run-time fatal error. In dash, it is a parse error. Therefore, forbidding functions with the same name as a special builtin is existing practice in some implementations. |
Desired Action |
Change
The function is named fname; the application shall ensure that it is a name (see XBD Section 3.230, on page 70).
to
The function is named fname; the application shall ensure that it is a name (see XBD Section 3.230, on page 70) and that it does not match the name of a special built-in utility. |
Tags |
tc1-2008 |
|
Attached Files |
|
|