GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Tue Oct 21, 2014 10:21 am

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: I am bit irritated...
PostPosted: Wed Jun 18, 2008 11:26 pm 
Offline
GTK+ Geek

Joined: Sat May 10, 2008 1:52 pm
Posts: 54
It is unavoidable a lot of times not to use standard library functions,
so I keep getting compiler warnings like:
"warning: implicit declaration of function ‘atoi’" (although I do have
the appropriate #include...)

Is there any #pragma or compiler settings to avoid these warnings?

Peter


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 19, 2008 3:42 am 
Offline
Never Seen the Sunlight

Joined: Thu Jun 14, 2007 11:02 pm
Posts: 923
Location: Falun, WI USA
first off, it's good to have the headers (atoi is in stdlib.h), so you shouldn't ignore the warnings.
that being said, if you feel that you must suppress the warnings, for gcc, you would pass:
-w (not -W)
for msvc's compiler, I believe it would be:
/w (not /W)
(note that I don't use it, I just got it from here: http://msdn.microsoft.com/en-us/library/19z1t1wy.aspx )


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 19, 2008 12:27 pm 
Offline
GTK+ Geek

Joined: Sat May 10, 2008 1:52 pm
Posts: 54
dreblen wrote:
first off, it's good to have the headers (atoi is in stdlib.h), so you shouldn't ignore the warnings.
that being said, if you feel that you must suppress the warnings, for gcc, you would pass:
-w (not -W)
for msvc's compiler, I believe it would be:
/w (not /W)
(note that I don't use it, I just got it from here: http://msdn.microsoft.com/en-us/library/19z1t1wy.aspx )


Dear dreblen,

I do have #include <stdlib.h> in the code, still I have the warning....
Peter


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 19, 2008 1:19 pm 
Offline
GTK+ Guru

Joined: Sun Apr 06, 2008 6:43 pm
Posts: 286
Location: Fortress of solitude
@Peter: Are you sure that #include <stdlib.h> is in the same file where is your atoi?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 19, 2008 2:50 pm 
Offline
GTK+ Geek

Joined: Sat May 10, 2008 1:52 pm
Posts: 54
Joel wrote:
@Peter: Are you sure that #include <stdlib.h> is in the same file where is your atoi?

Ouch. you were right. I was looking at the wrong file. stdlib include was missing.
Thanks man.
Peter


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group