I am not very sure if this is off topic.
I am facing a problem in variable argument passing in linux-gcc-ppc.
[EMAIL PROTECTED] ~/prg]$ cat macro2.c
#define __KERNEL__
#define bet_syslog(warning, format, msg...)\
do \
{ \
printk( "<%d> In file %s, line %d, function %s(). " format "\n",\
warning, __FILE__, __LINE__, __FUNCTION__, ##msg) ;\
} while (0)
void hell()
{
bet_syslog(1,"Test Message - 1");
bet_syslog(2,"Test Message - 2%d",100);
return ;
}
[EMAIL PROTECTED] ~/prg]$ ppc-linux-gcc -E macro2.c
# 1 "macro2.c"
void hell()
{
do { printk( "<%d> In file %s, line %d, function %s(). " "Test
Message - 1" "\n", 1 , "macro2.c", 11, ) ;} while (0) ;
do { printk( "<%d> In file %s, line %d, function %s(). " "Test
Message - 2%d" "\n", 2 , "macro2.c", 12, __FUNCTION__,100 ) ;} while (0) ;
return ;
}
[EMAIL PROTECTED] ~/prg]$ ppc-linux-gcc -v
ppc-linux-gcc: Actual path = '/opt/hardhat/previewkit/ppc/82xx/bin/'
Actual name = 'ppc_82xx-gcc'
Invoking
/opt/hardhat/previewkit/ppc/82xx/bin/../lib/gcc-lib/powerpc-hardhat-linux/2.95.3/ppc_82xx-gcc
Reading specs from
/opt/hardhat/previewkit/ppc/82xx/bin/../lib/gcc-lib/powerpc-hardhat-linux/2.95.3/specs
gcc version 2.95.3 20010315 (release/MontaVista)
[EMAIL PROTECTED] ~/prg]$ gcc -E ./macro2.c
# 9 "macro2.c"
void hell()
{
do { printk( "<%d> In file %s, line %d, function %s(). " "Test
Message - 1" "\n", 2, "macro2.c", 11, __FUNCTION__) ;} while (0);
do { printk( "<%d> In file %s, line %d, function %s(). " "Test
Message - 1%d" "\n", 2, "macro2.c", 12, __FUNCTION__, 100) ;} while (0);
return ;
}
In the first message using ppc-linux-gcc , __FUNCTION__ is missing and
one `,` is extra.
Because of this, it will not compile, stating a parse error.
No such problems in gcc (i386)
I am using monta vista linux.
Please CC to me, because I am not a member of this list.
Thanks in acvance.
Om.