Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MtTAS-0006E5-Ou for qemu-devel@nongnu.org; Thu, 01 Oct 2009 17:26:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MtTAQ-0006DE-Sz for qemu-devel@nongnu.org; Thu, 01 Oct 2009 17:26:28 -0400 Received: from [199.232.76.173] (port=46193 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtTAQ-0006D9-PJ for qemu-devel@nongnu.org; Thu, 01 Oct 2009 17:26:26 -0400 Received: from fe01x03-cgp.akado.ru ([77.232.31.164]:62891 helo=akado.ru) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MtTAQ-00038P-Cb for qemu-devel@nongnu.org; Thu, 01 Oct 2009 17:26:26 -0400 Date: Fri, 2 Oct 2009 01:26:24 +0400 (MSD) From: malc Subject: Re: [Qemu-devel] Questions on audio_atexit(), possibly bugs In-Reply-To: <87ws3f3zsb.fsf@pike.pond.sub.org> Message-ID: References: <87y6nw9koq.fsf@pike.pond.sub.org> <871vlo9gz5.fsf@pike.pond.sub.org> <87ws3f3zsb.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: Markus Armbruster Cc: qemu-devel@nongnu.org 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. -- mailto:av1474@comtv.ru