From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arkadiusz Miskiewicz Date: Fri, 02 Apr 2004 13:05:32 +0000 Subject: Re: bashizm in hotplug scripts (including 20040401) Message-Id: <200404021505.32878.arekm@pld-linux.org> List-Id: References: <200404020211.45303.arekm@pld-linux.org> In-Reply-To: <200404020211.45303.arekm@pld-linux.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org Dnia Friday 02 of April 2004 03:09, Martin Schwenke napisa=B3: > Yuck! In section 2.6.4, the standard says: > > Only the decimal-constant, octal-constant, and hexadecimal-constant > constants specified in the ISO C standard, Section 6.4.4.1 are > required to be recognised as constants. Missed that :/ > Arkadiusz> [...] but for example on pdksh run in sh mode it > Arkadiusz> overflows - example: > > Arkadiusz> [arekm@mobarm arekm]$ echo $((16#ff)) > Arkadiusz> 255 > Arkadiusz> [arekm@mobarm arekm]$ echo $((16#ffffffff)) > Arkadiusz> -1 > > Debian's ash-0.4.25 overflows too. > > Note that POSIX says: > > Only signed long integer arithmetic is required. So hotplug scripts still need the change because they do arithmetic beyond = signed long: [misiek@arm ~/rpm/SOURCES/hotplug-2004_04_01.org]$ grep -r 0xffffffff . ./etc/hotplug/pci.agent:PCI_ANY=3D$((0xffffffff)) > Looks like the best way of fixing this is to leave hotplug the way it > is (except if a workaround for the overlows is needed) It's needed. Either create some workaround or put #!/bin/bash there. Any=20 propositions for workaround? > and fix=20 > pdksh... :-) http://cvs.pld-linux.org/cgi-bin/cvsweb/SOURCES/pdksh-hex.patch?rev=3D1.1 f= rom=20 OpenBSD people > peace & happiness, > martin --=20 Arkadiusz Mi=B6kiewicz CS at FoE, Wroclaw University of Technology arekm.pld-linux.org, 1024/3DB19BBD, JID: arekm.jabber.org, PLD/Linux ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id638&op=CCk _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel