The diagnostic for use of __func__ outside a function, as tested in gcc.dg/func-outside-*.c, wrongly has line number 0 instead of the line number of the bad use of __func__. func-outside-1.c:0: warning: '__func__' is not defined outside of function scope This is a regression from 3.2.x. When fixed, the " { target *-*-* } 0" should be removed from those testcases so they test the diagnostic in its proper location.
Confirmed.
Subject: Bug 18322 CVSROOT: /cvs/gcc Module name: gcc Changes by: jsm28@gcc.gnu.org 2004-11-09 21:22:27 Modified files: gcc : ChangeLog c-common.c gcc/testsuite : ChangeLog gcc/testsuite/gcc.dg: func-outside-1.c func-outside-2.c Log message: PR c/18322 * c-common.c (fname_decl): Don't use line number of decl in diagnostic. testsuite: * gcc.dg/func-outside-1.c, gcc.dg/func-outside-2.c: Correct expected diagnostic location. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.6257&r2=2.6258 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-common.c.diff?cvsroot=gcc&r1=1.583&r2=1.584 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4566&r2=1.4567 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/func-outside-1.c.diff?cvsroot=gcc&r1=1.1&r2=1.2 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/func-outside-2.c.diff?cvsroot=gcc&r1=1.1&r2=1.2
Subject: Bug 18322 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: jsm28@gcc.gnu.org 2004-11-10 19:46:34 Modified files: gcc : ChangeLog c-common.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/gcc.dg: func-outside-1.c func-outside-2.c Log message: PR c/18322 * c-common.c (fname_decl): Don't use line number of decl in diagnostic. testsuite: * gcc.dg/func-outside-1.c, gcc.dg/func-outside-2.c: New tests. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.685&r2=2.2326.2.686 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-common.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.476.4.9&r2=1.476.4.10 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.306&r2=1.3389.2.307 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/func-outside-1.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.2.4.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/func-outside-2.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.2.4.1
Fixed in 3.4.x. Thr formating machinery is different in 3.3.6 and this is not critical for 3.3.6. So closing.