|
楼主 |
发表于 2007-9-20 09:33:36
|
显示全部楼层
Post by herberteuler
Don't you read the comment above the macros?
- /*! \note
- \verbatim
- Note:
- It is very important to use only unsigned variables to hold
- bit flags, as otherwise you can fall prey to the compiler's
- sign-extension antics if you try to use the top two bits in
- your variable.
- The flag macros below use a set of compiler tricks to verify
- that the caller is using an "unsigned int" variable to hold
- the flags, and nothing else. If the caller uses any other
- type of variable, a warning message similar to this:
- warning: comparison of distinct pointer types lacks cast
- will be generated.
- The "dummy" variable below is used to make these comparisons.
- Also note that at -O2 or above, this type-safety checking
- does _not_ produce any additional object code at all.
- \endverbatim
- */
复制代码
不好意思,这个我倒确实没有注意,thx |
|