From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eigenstate.org ([206.124.132.107]) by ewsd; Tue Jun 18 12:36:44 EDT 2019 Received: from eigenstate.org (localhost [127.0.0.1]) by eigenstate.org (OpenSMTPD) with ESMTP id e66154a1 for <9front@9front.org>; Tue, 18 Jun 2019 09:36:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=eigenstate.org; h=date :from:to:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=mail; bh=wssbPsWc9ij7 Bgj1oA1tph0eA5c=; b=TL5Q91TU4SYFfPEmcKCR++VtHyrs5cFnQ9ui0DkY7/Ub yOdNdNoecb6c1zfp3bkMJNI3uQf2ALAllbxCl+CuvO4y1DIoRtK0cyhYOgiECrzd pZ4gxdemzbxzC8oH3WSep8BA5zojO+x9vZvBaNboCnKmIKxwPgFxxkP5L642jJY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=eigenstate.org; h=date:from :to:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=mail; b=iHRadQ 2vaXee3pjPfQCNngyXjHrCPC9QtYQKASJOoE+aBQK4nb4AVvQaYMUJf0EEb0rgWz n3Q/qtpANiUUezkI/sjQqVTp8IsA9jVrA1dHSu1aRfX0fWtBhQzL+aH0Dj3FddaY YPhJ5zGWB9zB/SMdBFwzST34/o1d5U8kn+/ao= Received: from oneeye (c-76-21-119-139.hsd1.ca.comcast.net [76.21.119.139]) by eigenstate.org (OpenSMTPD) with ESMTPSA id b6655aa5 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <9front@9front.org>; Tue, 18 Jun 2019 09:36:42 -0700 (PDT) Date: Tue, 18 Jun 2019 09:36:41 -0700 From: Ori Bernstein To: 9front@9front.org Subject: Re: [9front] Ape: Fix assert warnings. Message-Id: <20190618093641.2ec61addb29b579338cacbde@eigenstate.org> In-Reply-To: References: X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: plugin hardware On Tue, 18 Jun 2019 16:35:07 +0200, cinap_lenrek@felloff.net wrote: > this is not full fix tho. it still warns for non-constant case... stdio putc has a similar issue to this, but it *needs* to return an int, so a void cast isn't quite enough anyways. I'd thought of making USED() an expression, so we could do: x = USED(a?b:c) Thinking about it more, a better solution may be to say that if one of the ternary branches has side effects, the other is implicitly USED(), which will solve this warning. 0 ? 0 : 1 should warn, but 1 ? 0 : printf("nope"); should be silent, because printf has a side effect.