From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MtUKc-00042X-Vg for qemu-devel@nongnu.org; Thu, 01 Oct 2009 18:41:03 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MtUKY-000413-Ea for qemu-devel@nongnu.org; Thu, 01 Oct 2009 18:41:02 -0400 Received: from [199.232.76.173] (port=41957 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtUKY-00040p-Ac for qemu-devel@nongnu.org; Thu, 01 Oct 2009 18:40:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49411) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MtUKX-0007Qd-PW for qemu-devel@nongnu.org; Thu, 01 Oct 2009 18:40:58 -0400 Subject: Re: [Qemu-devel] Questions on audio_atexit(), possibly bugs References: <87y6nw9koq.fsf@pike.pond.sub.org> <871vlo9gz5.fsf@pike.pond.sub.org> <87ws3f3zsb.fsf@pike.pond.sub.org> From: Markus Armbruster Date: Fri, 02 Oct 2009 00:40:42 +0200 In-Reply-To: (malc's message of "Fri\, 2 Oct 2009 01\:26\:24 +0400 \(MSD\)") Message-ID: <871vlmwxed.fsf@pike.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: malc Cc: qemu-devel@nongnu.org malc writes: > On Thu, 1 Oct 2009, Markus Armbruster wrote: > >> malc writes: >> >> > On Thu, 1 Oct 2009, Markus Armbruster wrote: >> > >> >> malc writes: >> >> >> >> > On Wed, 30 Sep 2009, Markus Armbruster wrote: >> >> > >> > >> > [..snip..] >> > > [..snip..] > >> >> The ctl_out() and ctl_in() callbacks I checked (ALSA, OSS), get the >> variable argument unconditionally. >> >> Getting more variable arguments than the caller passed is undefined >> behavior (C99 7.15.1.1), although in practice is usually gets some >> unpredictable value, which is harmless as long as it's not actually >> used. > > I wasn't aware of that, thank you for pointing that out. > >> >> Not getting all variable arguments the caller passed is fine. >> >> So, the calls you fixed up weren't broken in the first place, and the >> change isn't worth the trouble, in my opinion. >> >> However, there are calls with undefined behavior, because they pass two >> arguments (two fixed, zero variable), and at least some callees use >> three (two fixed, one variable). Fix for that below. >> > > I'd much rather fix oss and alsa, they should look for poll_mode only in > case of enable, one more time thanks for heads up. Makes sense. Better check the other drivers as well, because I didn't.