From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32180 invoked by alias); 22 Apr 2011 16:04:29 -0000 Received: (qmail 32170 invoked by uid 22791); 22 Apr 2011 16:04:26 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 22 Apr 2011 16:04:09 +0000 From: "sourceforge.com-20020529 at reg dot pizzolato.net" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/48730] New: static function scope not honored by -fms-extensions X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sourceforge.com-20020529 at reg dot pizzolato.net X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Fri, 22 Apr 2011 16:04:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-04/txt/msg02363.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48730 Summary: static function scope not honored by -fms-extensions Product: gcc Version: 4.5.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned@gcc.gnu.org ReportedBy: sourceforge.com-20020529@reg.pizzolato.net gcc running on Windows via MinGW. Microsoft describes extensions to C at http://msdn.microsoft.com/en-us/library/34h23df8(v=vs.80).aspx The case I encountered relates to the following: extern int clip(); static int clip() {} which gcc fails to compile: clip.c:2:12: error: static declaration of 'clip' follows non-static declaration clip.c:1:12: note: previous declaration of 'clip' was here The original code which encountered this error wasn't this simple. The 'extern int function();' was buried in some deeply nested layers of system include files, and the locally scoped function had a name which was identical to the one defined in the include file. The code compiles cleanly with Microsoft's compilers but fails with the above error when compiled with gcc. gcc behaves the same, in this case, without regard to the presense of the '-fms-extensions' command option. It would seem appropriate that this behavior like the microsoft compilers should be part of the functionality of '-fms-extensions'.