From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11444 invoked by alias); 11 Apr 2006 00:37:00 -0000 Received: (qmail 11419 invoked by uid 48); 11 Apr 2006 00:36:58 -0000 Date: Tue, 11 Apr 2006 00:37:00 -0000 Subject: [Bug c/27108] New: syntax error with same-name typedef and local variable using va_arg X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jesuswaffle at gmail dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-04/txt/msg00828.txt.bz2 List-Id: When compiling this (after cpp): # 1 "test.c" # 1 "" # 1 "" # 1 "test.c" # 1 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/include/stdarg.h" 1 3 4 # 43 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/include/stdarg.h" 3 4 typedef __builtin_va_list __gnuc_va_list; # 105 "/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/include/stdarg.h" 3 4 typedef __gnuc_va_list va_list; # 2 "test.c" 2 typedef int foo; pathological(int a, ...) { int foo; va_list ap; __builtin_va_arg(ap,foo); } I get this error: test.c: In function `pathological': test.c:9: error: parse error before "foo" Removing the 'int foo' declaration in 'pathological' fixes the error. I'm not sure what to make of this; however, I would suspect that the variable named foo is preventing gcc from seeing the typedef named foo. -- Summary: syntax error with same-name typedef and local variable using va_arg Product: gcc Version: 3.4.4 Status: UNCONFIRMED Severity: minor Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jesuswaffle at gmail 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=27108