From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18447 invoked by alias); 7 Jun 2010 07:27:24 -0000 Received: (qmail 18410 invoked by uid 48); 7 Jun 2010 07:27:09 -0000 Date: Mon, 07 Jun 2010 07:27:00 -0000 Subject: [Bug c/44438] New: ISO C99 6.7.4p3 not obeyed in C99 mode X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "nickc at redhat dot com" 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: 2010-06/txt/msg00688.txt.bz2 Section 6.7.4 paragraph 3 of the ISO C99 standard states that: An inline definition of a function with external linkage ... shall not contain a reference to an identifier with internal linkage. GCC has code to check for this condition, but it does not work in C99 mode. Reproduce by: % cat iso-c99-test.c static int a = 7; extern inline int foo (void) { return a; } int main (void) { return foo (); } % gcc -c iso-c99-test.c iso-c99-test.c:2:39: warning: 'a' is static but used in inline function 'foo' which is not static [enabled by default] % gcc -c -std=c99 iso-c99-test.c % -- Summary: ISO C99 6.7.4p3 not obeyed in C99 mode Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: nickc at redhat dot com GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44438