Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > STL Warnings Driving Me Nutz!

STL Warnings Driving Me Nutz!
Thread Tools
Mac Elite
Join Date: Sep 2000
Location: Tempe, AZ
Status: Offline
Reply With Quote
Jul 22, 2002, 06:53 PM
 
Try the following easy program in Project Builder
</font><blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">#include &lt;deque&gt;

int main (int argc, const char * argv[]) {
deque&lt;int&gt; myDeque1, myDeque2;

myDeque1.push_back(5);
myDeque2 = myDeque1;
return 0;
}</pre><hr /></blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">This gives a warning that a signed value is being compared with an unsigned. Changing the templatized type of the deque to signed int or unsigned int doesn't make any difference. The warning is produced by the line that assigns myDeque1 to myDeque2.

This isn't a huge deal, but I like to write my code so that it produces no warnings, so this is driving me nuts.

Anyone got any clues on how to fix this without editing the STL headers?
Geekspiff - generating spiffdiddlee software since before you began paying attention.
     
Forum Regular
Join Date: Feb 2002
Location: Fort Lauderdale, Florida
Status: Offline
Reply With Quote
Jul 22, 2002, 09:39 PM
 
You can use a #pragma to suppress compiler warnings. I dont remember the exact syntax, but I'm sure someone here does.
     
smeger  (op)
Mac Elite
Join Date: Sep 2000
Location: Tempe, AZ
Status: Offline
Reply With Quote
Jul 23, 2002, 02:35 AM
 
I guess I could use the pragma, but I'd rather fix it than work around it. Still, I hadn't thought of the pragma, so I guess that's what I'll do if I can't figure out anything else.

Any other ideas?
Geekspiff - generating spiffdiddlee software since before you began paying attention.
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Jul 23, 2002, 02:53 PM
 
Have you tried using gcc3 in the April 2002 DT preview?
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -4. The time now is 12:00 PM.
All contents of these forums © 1995-2015 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2015, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2