| OS X - Development and Darwin Discussion and questions about development for Mac OS X. |
| Post Reply | New Thread | Subscribe |
|
|
Thread Tools |
![]() Member Since: Oct 27, 2008
Posts: 13
![]() |
Hi
I am using this snippet of code void * handle_; if (handle_ =dlopen("/System/Library/Frameworks/DiskArbitration.Framework/Versions/A/DiskArbitration",RTLD_NOW)) { printf("............"); } else if (handle_ =dlopen("/System/Library/PrivateFrameworks/DiskArbitration.Framework/Versions/A/DiskArbitration",RTLD_NOW)) { printf("................."); } But i am getting the warning : "suggest parentheses around assignment used as truth value" for the first line i,e the for the "for" loop....can somebody help me to get rid of this warning..
******Rouble****** |
| QUOTE Thanks | |
![]() Member Since: Mar 15, 2007
Posts: 161
![]() Mac Specs: 17" MacBook Pro, 2.33GHz C2D, 2GB RAM
|
Two ways to handle this:
1) Change the line(s) to make the assignment result's participation in a boolean expression explicit, i.e. "if ((bool)(handle_ = dlopen()) == true)". Actually just the extra pair of parens would suppress the warning, but that would be ugly code in my opinion ... it's better to demonstrate that you are deliberately making an assignment and then comparing the result to a boolean value. 2) If you prefer the original, more terse version of the code, you can go into the Build options on the target executable, search for "parentheses" under GCC Warnings, and unselect that checkbox for all configurations. (This is for Xcode 3.1.1, but I assume that earlier versions probably had a similar build option.) Last edited by mystic_fm; 01-09-2009 at 06:11 AM. |
| QUOTE Thanks | |
![]() Member Since: Jan 07, 2009
Location: USA
Posts: 4
![]() Mac Specs: SpaceTeaBoo
|
I need some help. Is here anybody who studies at Medic school or a college or may be university. May be somebody knows some sites of medic school material I need some texts about health care, different catigories ex mental health, women health and other. I should make my study soon. Please help me to find some info. And it should be information that google cant find, cos my teacher kill me for that. Thanks for help |
||||
| QUOTE Thanks | |||||
| Post Reply | New Thread | Subscribe |
| Thread Tools | |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
|
|||||||
Thread |
Thread Starter |
Forum |
Replies |
Last Post |
| Leopard Gone Very Slow on iBook | chuckalicious | OS X - Operating System | 4 | 12-31-2007 04:58 PM |
| first mac , i'm not pleased | lilmill | Switcher Hangout | 34 | 12-17-2007 09:05 PM |
| error message during weekly maintenance | ajresovsky | Schweb's Lounge | 0 | 06-18-2006 05:11 PM |
All times are GMT -4. The time now is 10:46 AM.
Powered by vBulletin