autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Use of double parentheses


From: Eric Blake
Subject: Re: Use of double parentheses
Date: Mon, 01 Aug 2011 09:21:21 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20110713 Thunderbird/5.0

On 08/01/2011 09:13 AM, Paul Eggert wrote:
> On 08/01/11 05:23, Eric Blake wrote:
>>>    &&  ( (unset $as_var) || exit 1)>/dev/null 2>&1&&  unset $as_var || :
>>> done
>>>
>>>
>>> Wouldn't it mean that all '((' present in the "configure" script, and
>>> related to shell commands, should be rewritten to '( ('?
>>
>> It's not a bug in pdksh - POSIX was recently reworded to allow (( to
>> introduce arithmetic parsing on any shell that wants to provide it as an 
>> extension.
> 
> I just now looked at POSIX.1-2008, and can't see where it says that.

You didn't look at the open bug reports:

http://austingroupbugs.net/view.php?id=217

> 
> First, only '$((' is special; '((' without a preceding '$' is not special
> <http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_03>.
> So if pdksh 5.2.4 mishandles the above, then it does appear to be a bug.

(( without preceding '$' is now allowed, but not required, to be
special.  Portable programs must not use ((:

    If a character sequence beginning with (( and ending with )) would
    be syntactically valid as an arithmetic expansion if preceded by
    a '$', shells which implement an extension whereby ((expression))
    is evaluated as an arithmetic expression may treat the sequence
    as an arithmetic evaluation instead of a grouping command. A
    conforming application shall ensure that it separates the two
    leading '(' characters with white space if a grouping command
    beginning with '(' contains a compound-list beginning with '('
    and ending with ')', and the grouping command is syntactically
    valid as an arithmetic expression.

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]