bug or illegal code???

Scott Bambrough scottb@netwinder.org
Fri Nov 17 15:19:00 GMT 2000


/* 
If I compile the enclosed C code with 

  [root@mask scottb]# gcc -v
  Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
  gcc version 2.96 20000731 (Red Hat Linux 7.0)

I get the following warnings:

  [root@mask scottb]# gcc -O2 scott.c
  scott.c:10:47: warning: pasting would not give a valid preprocessing token
  scott.c:11:53: warning: pasting would not give a valid preprocessing token

Is this a pre-processor bug or illegal C code?
*/  

define err_abort(fmt, args...) err_out(__FILE__, __LINE__, fmt, ##args)

int err_out (char *file, int line, char *fmt, ...)
{
  return 0;
}

int main (int argc, char **argv)
{
   err_abort ("test output: %s\n", "my string");
   err_abort ("test output: %s %d\n", "my string", 1);
}


Scott

-- 
Scott Bambrough - Software Engineer
REBEL.COM    http://www.rebel.com
NetWinder    http://www.netwinder.org


More information about the Gcc-bugs mailing list