From owner-freebsd-toolchain@FreeBSD.ORG Mon Sep 22 16:20:36 2014 Return-Path: Delivered-To: freebsd-toolchain@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D110CE0; Mon, 22 Sep 2014 16:20:36 +0000 (UTC) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "troutmask.apl.washington.edu", Issuer "troutmask.apl.washington.edu" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0EACCFFC; Mon, 22 Sep 2014 16:20:36 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.9/8.14.9) with ESMTP id s8MGKYAH007965 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 22 Sep 2014 09:20:34 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.9/8.14.9/Submit) id s8MGKYBL007964; Mon, 22 Sep 2014 09:20:34 -0700 (PDT) (envelope-from sgk) Date: Mon, 22 Sep 2014 09:20:34 -0700 From: Steve Kargl To: Andriy Gapon Subject: Re: Is this a compiler bug? Message-ID: <20140922162034.GA7918@troutmask.apl.washington.edu> References: <20140922011946.GA4317@troutmask.apl.washington.edu> <670269FD-F75F-4044-8F3C-0260F58A70E2@me.com> <20140922014853.GA4469@troutmask.apl.washington.edu> <2EB3354D-0F65-4A79-A378-7F397911284A@me.com> <541FB79F.1070002@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <541FB79F.1070002@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: freebsd-toolchain@FreeBSD.org, Rui Paulo X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 16:20:36 -0000 On Mon, Sep 22, 2014 at 08:46:07AM +0300, Andriy Gapon wrote: > On 22/09/2014 05:20, Rui Paulo wrote: > > On Sep 21, 2014, at 18:48, Steve Kargl wrote: > >> On Sun, Sep 21, 2014 at 06:38:48PM -0700, Rui Paulo wrote: > >>> On Sep 21, 2014, at 18:19, Steve Kargl wrote: > >>>> > >>>> #include > >>>> #include > >>>> > >>>> int > >>>> main(void) > >>>> { > >>>> uint16_t i; > >>>> i = 0x3ffe+63; printf("%x\n", i); > >>>> return 0; > >>>> } > >>> > >>> Looks like it. Please file a bug report with LLVM. > >>> > >> > >> Unfortunately, llvm requires an account to report bugs. > > > > I think I know what's happening: "e" is being parsed as > > scientific notation. > > Interesting! One of the cases where the whitespace matters? > In a discussion on a GCC list, I was pointed to the section of n1256.pdf where preprocessing numbers are discussed. 0x3ffe+63 is preprocessed as a single token. When the parser finally gets around to classifying this token, it is neither a valid integer constant nor floating point constant. It's just a weird feature (idiosyncrasy?) of the C language. -- Steve