From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 83313 invoked by alias); 23 Oct 2017 14:47:39 -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 83301 invoked by uid 89); 23 Oct 2017 14:47:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=mingw64, Latest, Hx-ms-exchange-transport-fromentityheader:Hosted, H*c:HHH X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 23 Oct 2017 14:47:36 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v9NEhr9Z025106 for ; Mon, 23 Oct 2017 16:47:34 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2dqupv22ea-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 23 Oct 2017 16:47:34 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id D9DC134 for ; Mon, 23 Oct 2017 14:47:33 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node3.st.com [10.75.127.15]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A4EEE2870 for ; Mon, 23 Oct 2017 14:47:33 +0000 (GMT) Received: from SFHDAG5NODE3.st.com (10.75.127.15) by SFHDAG5NODE3.st.com (10.75.127.15) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Mon, 23 Oct 2017 16:47:32 +0200 Received: from SFHDAG5NODE3.st.com ([fe80::7c09:5d6b:d2c7:5f47]) by SFHDAG5NODE3.st.com ([fe80::7c09:5d6b:d2c7:5f47%20]) with mapi id 15.00.1347.000; Mon, 23 Oct 2017 16:47:32 +0200 From: Paolo ZAMBOTTI To: "cygwin@cygwin.com" Subject: cygwin x86_64: mingw64-g++ 6.4.0 (both i686 and x86_64) issue (bug?) with reinterpret_cast Date: Mon, 23 Oct 2017 14:47:00 -0000 Message-ID: x-ms-exchange-transport-fromentityheader: Hosted Content-Type: multipart/mixed; boundary="_002_e53af017e2d84c40bb763073b4d3fd00SFHDAG5NODE3stcom_" MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-10-23_06:,, signatures=0 X-SW-Source: 2017-10/txt/msg00267.txt.bz2 --_002_e53af017e2d84c40bb763073b4d3fd00SFHDAG5NODE3stcom_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-length: 1642 Hello, 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 Cygwin= distribution but I cannot test other mingw64 distributions so let me start= reporting the issue here... Once said that, I'm open to any suggestions for better reporting place... I'm not an expert in C and even less in C++ so I hope to not generate stupi= d noise... but the same code was compiling fine with previous version (5.4)= ... The attached file is the simplest example that triggers the issue. If I try to compile with "x86_64-w64-mingw32-gcc -o test.exe test.cpp" the = output is the following 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); ^~~~~~~~~~~~~ While, if I try to compile with "i686-w64-mingw32-gcc -o test.exe test.cpp"= the output is the following 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); ^~~~~~~~~~~~ The test is effectively build to always fail but the current behavior is ex= actly the opposite of what I was expecting: x86_64 complains with (-1LL) cast while I was expecting it to fail on (-1L) i686 complains with (-1L) cast while I was expecting it to fail on (-1LL) Just to complete the picture, my environment is: Windows 7 machine Latest Cygwin (updated today 23 -Oct-2017) Regards, Paolo. --_002_e53af017e2d84c40bb763073b4d3fd00SFHDAG5NODE3stcom_ Content-Type: text/plain; name="test.cpp" Content-Description: test.cpp Content-Disposition: attachment; filename="test.cpp"; size=387; creation-date="Mon, 23 Oct 2017 12:36:49 GMT"; modification-date="Mon, 23 Oct 2017 14:04:16 GMT" Content-Transfer-Encoding: base64 Content-length: 525 I2luY2x1ZGUgPHdpbmRvd3MuaD4KI2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQg bWFpbiAoaW50IGFyZ2MsIGNoYXIgKiphcmd2KSB7CiNpZmRlZiBfV0lONjQg CiAgc3RhdGljIGNvbnN0ZXhwciB2b2lkKiB0ZXN0MSA9ICh2b2lkKikoLTFM KTsKICBzdGF0aWMgY29uc3RleHByIHZvaWQqIHRlc3QyID0gKHZvaWQqKSgt MUxMKTsKCiAgcHJpbnRmKCIlbGx4LCAlbGx4XG4iLCB0ZXN0MSwgdGVzdDIp OwojZWxzZQogIHN0YXRpYyBjb25zdGV4cHIgdm9pZCogdGVzdDEgPSAodm9p ZCopKC0xTEwpOwogIHN0YXRpYyBjb25zdGV4cHIgdm9pZCogdGVzdDIgPSAo dm9pZCopKC0xTCk7CgogIHByaW50ZigiJWx4LCAlbHhcbiIsIHRlc3QxLCB0 ZXN0Mik7CiNlbmRpZgoKcmV0dXJuIDA7Cgp9 --_002_e53af017e2d84c40bb763073b4d3fd00SFHDAG5NODE3stcom_ Content-Type: text/plain; charset=us-ascii Content-length: 219 -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple --_002_e53af017e2d84c40bb763073b4d3fd00SFHDAG5NODE3stcom_--