From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 45346 invoked by alias); 11 Jun 2019 18:35:20 -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 45075 invoked by uid 89); 11 Jun 2019 18:35:20 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1389 X-HELO: smtp-out-no.shaw.ca Received: from smtp-out-no.shaw.ca (HELO smtp-out-no.shaw.ca) (64.59.134.12) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 11 Jun 2019 18:35:18 +0000 Received: from [192.168.1.114] ([24.64.172.44]) by shaw.ca with ESMTP id alc3hEhmJldkPalc4hwfpP; Tue, 11 Jun 2019 12:35:17 -0600 Reply-To: Brian.Inglis@SystematicSw.ab.ca Subject: Re: g++ doesn't diagnose implicit int error To: cygwin@cygwin.com References: <87imtcnik5.fsf@Rainer.invalid> From: Brian Inglis Openpgp: preference=signencrypt Message-ID: Date: Tue, 11 Jun 2019 18:35:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <87imtcnik5.fsf@Rainer.invalid> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-06/txt/msg00133.txt.bz2 On 2019-06-11 11:22, Achim Gratz wrote: > Keith Thompson writes: >> On Windows targets (including Cygwin and MinGW), the "-fms-extensions" >> option is enabled by default. This option enables certain Microsoft >> extensions -- and apparently inhibits any diagnostics for implicit int. >> >> It is unfortunate, and arguably a bug, that this means that >> "g++ -std=c++11 -pedantic" fails to diagnose implicit int errors. >> I'm not sure whether this is a bug in gcc or in the way Windows >> versions of gcc are built. > > In the case of Cygwin it is quite certainly a bug as Cygwin is not a > Windows target. Seems like ms-extensions is enabled if the target is x86 with MS ABI, or plan9-extensions is enabled. The former allows use of struct/union member names the same as typedef names, and the latter allows passing pointers to structs/unions and typedefs with anonymous fields, and referring to anonymous fields declared using typedefs. Cygwin may require these extensions to handle Windows structure definitions in a Windows compatible way, to allow compilation of the Windows C and C++ modules under winsup. That it enables C++ implicit int is unfortunate. -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada This email may be disturbing to some readers as it contains too much technical detail. Reader discretion is advised. -- 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