public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* [BUG] gcc-3.4.5-20050531 (i386): __FUNCTION__ as a part of the printf's format argument
@ 2005-07-25  8:41 Denis Zaitsev
  2005-07-25  8:51 ` Richard Guenther
  0 siblings, 1 reply; 12+ messages in thread
From: Denis Zaitsev @ 2005-07-25  8:41 UTC (permalink / raw)
  To: gcc, linux-gcc

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


Then, the problem is not printf-specific and is not depend of
<stdio.h>.  The next example gives the same error:


void y(const char *f, ...);
void z()
{
    y(__FUNCTION__ "\n");
}


If some args are present in the ellipsis section (i.e. y(__FUNCTION__
": %s\n", "xxx")), the problem doesn't vanish.  And, if __FILE__ is
used instead of __FUNCTION__, the problem is absent.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2005-07-25 17:15 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-25  8:41 [BUG] gcc-3.4.5-20050531 (i386): __FUNCTION__ as a part of the printf's format argument Denis Zaitsev
2005-07-25  8:51 ` Richard Guenther
2005-07-25  8:57   ` Paolo Carlini
2005-07-25  9:23     ` Robert Dewar
2005-07-25 16:30     ` Mike Stump
2005-07-25 16:49       ` Gabriel Dos Reis
2005-07-25 16:52         ` Paolo Carlini
2005-07-25 16:57           ` Robert Dewar
2005-07-25 17:15     ` Dale Johannesen
2005-07-25  9:05   ` Denis Zaitsev
2005-07-25  9:36     ` Paolo Bonzini
2005-07-25 11:31       ` Denis Zaitsev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).