DragonFly BSD
DragonFly submit List (threaded) for 2011-10
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

macro argument expansion bug


From: Maurizio Lombardi <m.lombardi85@xxxxxxxxx>
Date: Mon, 31 Oct 2011 12:14:46 +0100

Hi,

The attached patch fixes a bug in the AMD powernow driver, the abs()
macro was defined in a way that may lead to unexpected results due to
the macro argument expansion vs operator precedence:

----------
#define abs(x) ( x < 0 ? -x : x )
[...]
while (abs(vco_fid - vco_cfid) > 2) {
----------

Cheers,
-- 
--------------------
Maurizio Lombardi

Attachment: 0001-Fix-a-macro-argument-expansion-bug.patch
Description: Binary data



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