foralex / picoc

Automatically exported from code.google.com/p/picoc
0 stars 0 forks source link

Macro bug #153

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

#define F_ADD(a) (a + 3)

int ret = 0;
ret = F_ADD(2);
printf("%d",ret);
printf("%d",F_ADD(2));

What is the expected output? What do you see instead?
ret must be equal to 5 and instead it's still to zero. F_ADD(2) returns 
properly 5. 

What version of the product are you using? On what operating system?
v2.1 on UNIX and Windows OS

Please provide any additional information below.
if the variable is declared and initialized with macro, it works properly

#define F_ADD(a) (a + 3)

int ret = F_ADD(2);
printf(ret);

Original issue reported on code.google.com by ozlbi...@gmail.com on 6 Feb 2012 at 12:40

GoogleCodeExporter commented 8 years ago
Fixed by this patch: http://code.google.com/p/picoc/issues/detail?id=178

Original comment by broscuta...@gmail.com on 5 Mar 2013 at 7:22

GoogleCodeExporter commented 8 years ago
Thanks very much for all your patches broscutamaker. I'll merge them soon.

Original comment by zik.sale...@gmail.com on 6 Mar 2013 at 9:40

GoogleCodeExporter commented 8 years ago
Please find my patches here: https://bitbucket.org/a1ex/picoc-fork/commits/all

I'm not familiar with svn, but you can export the patches easily from bitbucket 
in order to merge them.

Original comment by broscuta...@gmail.com on 9 Mar 2013 at 10:11

GoogleCodeExporter commented 8 years ago
I've merged in this fix and all the other changes from picoc-fork.

Thanks broscutamaker, wonderful work!

Original comment by zik.sale...@gmail.com on 16 Mar 2013 at 7:40