Re: [Vala] [PATCH] Add parenthesis to macro substitutions



Hi,

thats a common problem with C makros. Here a better example:

public const double AAAA = 1.0 + 3.0;
public const double BBBB = 2.0 / AAAA;

BBBB will be replaced to 2.0 / 1.0 + 3.0 = 5.0 instead of 0.5.
The Patch add () around AAAA and the statement will be correct:

BBBB = 2.0 / ( 1.0 + 3.0 ) = 0.5

Regards, Frederik

Am Donnerstag, den 25.06.2009, 18:40 +0200 schrieb Jürg Billeter:
On Thu, 2009-06-25 at 17:24 +0800, Yu Feng wrote:
Only for expressions. No parenthesis is added to string macros.
A test is attached. Without the patch BBBB compiles to a wrong expression.

What do you mean with BBBB?

Jürg

_______________________________________________
Vala-list mailing list
Vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]