This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [BUG] gcc-3.4.5-20050531 (i386): __FUNCTION__ as a part of the printf's format argument


On Mon, Jul 25, 2005 at 10:51:23AM +0200, Richard Guenther wrote:
> On 7/25/05, Denis Zaitsev <zzz@anda.ru> wrote:
> > Such an example can't be compiled:
> > 
> > 
> > #include <stdio.h>
> > 
> > void x()
> > {
> >     printf(__FUNCTION__ "\n");
> > }
> > 
> > 
> > $ gcc printf.c -o fprintf
> > printf.c: In function `x':
> > printf.c:5: error: syntax error before string constant
> 
> __FUNCTION__ expands to a variable.  Use
> 
>  printf("%s\n", __FUNCTION__);
> 
> instead.  Btw, this list is for the development _of_ gcc, not with gcc.
> Use gcc-help for that.

Ok, but such a code used to be compiled succesively with gcc for
years.  Then, some change _in_ gcc has occured.  That is why I've
posted to here.

Really, I've met the problem, when I was compiling the X Window System
system.  The sources contain a lot of such an examples.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]