Re: [Vala] [PATCH] Add parenthesis to macro substitutions
- From: Jürg Billeter <j bitron ch>
- To: Frederik Sdun googlemail com
- Cc: vala-list <vala-list gnome org>
- Subject: Re: [Vala] [PATCH] Add parenthesis to macro substitutions
- Date: Thu, 25 Jun 2009 19:17:39 +0200
On Thu, 2009-06-25 at 18:51 +0200, Frederik Sdun wrote:
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
Thanks, it certainly helps to look at all attachments before
responding...
I've pushed a slightly different patch to avoid unnecessary parenthesis.
Jürg
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]