From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2557 Path: news.gmane.org!not-for-mail From: Bobby Bingham Newsgroups: gmane.linux.lib.musl.general Subject: Re: NULL Date: Sat, 12 Jan 2013 01:07:46 -0600 Message-ID: References: <20130109153630.GZ20323@brightrain.aerifal.cx> <1357973768.32505.5@driftwood> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1357974504 14707 80.91.229.3 (12 Jan 2013 07:08:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 12 Jan 2013 07:08:24 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2558-gllmg-musl=m.gmane.org@lists.openwall.com Sat Jan 12 08:08:42 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1TtvCp-0000m7-9t for gllmg-musl@plane.gmane.org; Sat, 12 Jan 2013 08:08:39 +0100 Original-Received: (qmail 30295 invoked by uid 550); 12 Jan 2013 07:08:21 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 30283 invoked from network); 12 Jan 2013 07:08:19 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=yljaPktLrqVOxsK4EjSuFNO4pRmcsA7WrlNP7vdtESg=; b=yM7JwdgyBPZev28qUyOkjQFhVDlkqxCsPi+gDUJCJ17htfUfhxF+OsWFHg3j7FMpVu MkY9mpk2PmxvLdHlQdbqVUyTeUGNIEUalPMPcr0TFGlIFfKhPjTxX55DBaavn930vNDV ZWlTRz79u37Hg73jdUWib8k17Ql8PKSp/IySPJ4y7fubZlcQH2SVCV8okFnQQx3zbaPb IrHOwocPZMkia+JqSnTu/V/vtJepc4Cc+qjZi9xATBFLpWrtg0AUe2uWqawbnr+u4MX9 k90N7IMSPzbPxD2xL+G+bORT765xpoBUizBlwu3LNKglDomDszwHdyHEK+fKpvk7GfW6 TRzw== In-Reply-To: <1357973768.32505.5@driftwood> Xref: news.gmane.org gmane.linux.lib.musl.general:2557 Archived-At: On Sat, Jan 12, 2013 at 12:56 AM, Rob Landley wrote: >> int null_is_ptr_type() >> { >> char s[1][1+(int)NULL]; >> int i = 0; >> return sizeof s[i++], i; >> } > > > (int)NULL is 0 according to C99 so the NULL in there has no effect. And > referring to "i++" and "i" in the same statement is explicitly undefined > behavior (comma is not a sequence point, the compiler is free to evaluate > those in any order and different optimization flags _will_ change that > order; I got bit by that many moons ago). > >From c99 section 6.5.17 Comma operator: "The left operand of a comma operator is evaluated as a void expression; there is a sequence point after its evaluation. Then the right operand is evaluated; the result has its type and value" -- Bobby Bingham