1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-17 09:07:32 +00:00
cc65/test/ref/cc65090124.c

64 lines
981 B
C
Raw Normal View History

2014-09-24 14:45:10 +00:00
/*
2022-04-17 14:07:52 +00:00
!!DESCRIPTION!!
2014-09-24 14:45:10 +00:00
!!ORIGIN!! testsuite
!!LICENCE!! Public Domain
!!AUTHOR!!
*/
#include <stdio.h>
2014-09-24 14:45:10 +00:00
/*
2022-04-17 14:07:52 +00:00
there is a bug in the preprocessor (i think) ... the following works
2014-09-24 14:45:10 +00:00
(compiles) correctly:
unsigned long fs,fd,a;
unsigned long _func(unsigned long x,unsigned long y)
{
return 0;
}
int main(void)
{
fs=(_func((fd/a),(_func(2,0x0082c90f))));
}
now if i wrap _func into a macro like this:
#define func(x,y) _func(x,y)
int main(void)
{
fs=(func((fd/a),(func(2,0x0082c90f))));
}
2022-04-17 14:07:52 +00:00
i get "Error: ')' expected" on that line. (this is with the snapshot, freshly
2014-09-24 14:45:10 +00:00
compiled 5 minutes ago)
*/
unsigned long fs,fd,a;
unsigned long _func1(unsigned long x,unsigned long y)
{
return 0;
}
int test1(void)
{
fs=(_func1((fd/a),(_func1(2,0x0082c90f))));
}
#define func(x,y) _func1(x,y)
int test2(void)
{
fs=(func((fd/a),(func(2,0x0082c90f))));
}
int main(void)
{
printf("it works :)\n");
return 0;
}