From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 35953 invoked by alias); 23 Oct 2017 23:26:44 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 35939 invoked by uid 89); 23 Oct 2017 23:26:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-pf0-f169.google.com Received: from mail-pf0-f169.google.com (HELO mail-pf0-f169.google.com) (209.85.192.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 23 Oct 2017 23:26:41 +0000 Received: by mail-pf0-f169.google.com with SMTP id t188so18250463pfd.10 for ; Mon, 23 Oct 2017 16:26:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to; bh=cNVews9c+/M3HVCVVCFzYktIkodwawUewiA04tFjHGY=; b=NvRSEX/l/9JhWyYb4+LACGFmJhRKcBJH4pfmX1ccwGcPEGkuUpu4mFOzCyuNijFj7g Ut/q3ASofuCo6cw05T47Y2sDghw4p5jA77Jxb+ywpSW7F3ZK9jUIP267mncNLQiiOh8t YSgLoBWICUV3V5t/gHfBtV2+74OvlGAo89i/NnRuJAJFWLOYbAsEFobCx5KERvEwT9o/ j/DgmNapfJQTc1Wxig27n62MwGRpXREnMdzcLBC4wbgMbkmZDwrk9rusu2QkhvndtRte bP+EhR7SiuF80IK3DV8Yn337tvWjG/Wa1XMn9B2WBJR2kwBWY1+g+TRL76d/epHXzQ38 Y5jQ== X-Gm-Message-State: AMCzsaUKCe+DDiG+tE3u59T4Kg8KnC/CZhKedpuGk6Iwj0HO/k9a56UR ZxAtQ/TsE+hzoDdOVQm5m3gx8A== X-Google-Smtp-Source: ABhQp+SZ7m3Jdk29KzVLV8A7kA/2AHFA8AQdOsPYWuWlbG3UwgQ1/kRcn+Z+qAp2PVuO3lZEbGg7xQ== X-Received: by 10.84.209.164 with SMTP id y33mr9006152plh.439.1508801200173; Mon, 23 Oct 2017 16:26:40 -0700 (PDT) Received: from ?IPv6:2001:e68:4074:25d7:f64d:30ff:fe63:5a5a? ([2001:e68:4074:25d7:f64d:30ff:fe63:5a5a]) by smtp.gmail.com with ESMTPSA id 84sm14677893pfy.179.2017.10.23.16.26.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Oct 2017 16:26:39 -0700 (PDT) Subject: Re: cygwin x86_64: mingw64-g++ 6.4.0 (both i686 and x86_64) issue (bug?) with reinterpret_cast To: cygwin@cygwin.com References: From: JonY <10walls@gmail.com> Message-ID: Date: Mon, 23 Oct 2017 23:26:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="k18dNCcvlPHOvNwgGE6HgkXjtOEESAu8P" X-IsSubscribed: yes X-SW-Source: 2017-10/txt/msg00275.txt.bz2 --k18dNCcvlPHOvNwgGE6HgkXjtOEESAu8P Content-Type: multipart/mixed; boundary="mNFn1frOkiRNx1JWQVBU54SK22U58V6Bm"; protected-headers="v1" From: JonY <10walls@gmail.com> To: cygwin@cygwin.com Message-ID: Subject: Re: cygwin x86_64: mingw64-g++ 6.4.0 (both i686 and x86_64) issue (bug?) with reinterpret_cast References: In-Reply-To: --mNFn1frOkiRNx1JWQVBU54SK22U58V6Bm Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Content-length: 1808 On 10/23/2017 02:47 PM, Paolo ZAMBOTTI wrote: > Hello, >=20 > I'm having some issues while compiling C++ code with mingw64 c++ compiler= (6.4.0) distributed within Cygwin packages. > I can guess the issue I'm going to report is not strictly related to Cygw= in distribution but I cannot test other mingw64 distributions so let me sta= rt reporting the issue here... > Once said that, I'm open to any suggestions for better reporting place... >=20 > I'm not an expert in C and even less in C++ so I hope to not generate stu= pid noise... but the same code was compiling fine with previous version (5.= 4) ... >=20 Neither am I. > The attached file is the simplest example that triggers the issue. >=20 > If I try to compile with "x86_64-w64-mingw32-gcc -o test.exe test.cpp" th= e output is the following >=20 > test.cpp: In function 'int main(int, char**)': > test.cpp:7:34: error: reinterpret_cast from integer to pointer > static constexpr void* test2 =3D (void*)(-1LL); > ^~~~~~~~~~~~~ >=20 > While, if I try to compile with "i686-w64-mingw32-gcc -o test.exe test.cp= p" the output is the following >=20 > test.cpp: In function 'int main(int, char**)': > test.cpp:12:34: error: reinterpret_cast from integer to pointer > static constexpr void* test2 =3D (void*)(-1L); > ^~~~~~~~~~~~ >=20 As a comparison, both -1L and -1LL fails for me on 64bit Linux with gcc-6.4.0. > The test is effectively build to always fail but the current behavior is = exactly the opposite of what I was expecting: > x86_64 complains with (-1LL) cast while I was expecting it to fail on (-1= L) > i686 complains with (-1L) cast while I was expecting it to fail on (-1LL) >=20 I think it is best to check with gcc-help what the correct behavior is. --mNFn1frOkiRNx1JWQVBU54SK22U58V6Bm-- --k18dNCcvlPHOvNwgGE6HgkXjtOEESAu8P Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" Content-length: 858 -----BEGIN PGP SIGNATURE----- iQJGBAEBCAAwFiEE5QrdnbBX9Ppk4bbPcTtf4pwUXUUFAlnuelESHDEwd2FsbHNA Z21haWwuY29tAAoJEHE7X+KcFF1FIzAP/iTHawOMcDcKQjprKKR+SoGc/BjGAg3B LBjbehoonA8XzvcTQXgKsGQ4UV7R7flk/4Tuf9XEjp7hsOx8qLiyFRXyZy369uAw fD1WTWKW5RjmkOc+cKv5PurKCCp3XXRU1oIzSK72Ay2D7ev4bs9UYInCsB2xHHac z4tbqoBOYluDpKb2UCUMJqY80aY/L5OIpK2HEHjjEYxPoh5r8R2fcEB4vZY18iTH od1yWZPxOVNWKnefzCWxDql55LVfhqOIPiYNHjfB2dqHaGNIvPl7sw6GCD1z6QC5 cge6XrNQtwBI558DB8D8JB6XhoG4VQRtH5Liv/ZPd299xXS010yeyBrYBDNyqEFs YG8D33POiYojDSO/yvaZEFKvu30GeiXZd9kLv4oYXnLrF8tALTk1+bZE6NzDPO7T xxq7hV15KzfqF95jSVex+IuN3J/Owt4F7H7rQf82KazgNz8s2A5ghPOOqWqXGPvc h6mXtl1PHdt63aWEW9cmqTMHgsjrqJH9MgF26Yb7+4cPt/+JaqSZ+joykTaAH2Bm LlKTb+kBr2ZKPE5LysKzOpFCUg68A3qgX0FAjiU3bDB17o9+1S72mZ441wYC9ZFk cywfrzL+vOm42BGwOX6QtduwjU3RqyZQqdw/pQev/OeKPn+IZH0rajHmY6lzn5bL pZuQcXqw7N2o =iApT -----END PGP SIGNATURE----- --k18dNCcvlPHOvNwgGE6HgkXjtOEESAu8P--