LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 01-26-2004, 03:06 PM   #1
h/w
Senior Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Debian Testing
Posts: 1,286

Rep: Reputation: 45
removing warnings


hi, when we dont include the headers in C, and call printf() or exit(), we get the warning of an implicit declaration of those functions.
is there a way to not get these warnings, and not include the headers at the same time?

thanks.
 
Old 01-26-2004, 03:41 PM   #2
Strike
Member
 
Registered: Jun 2001
Location: Houston, TX, USA
Distribution: Debian
Posts: 569

Rep: Reputation: 31
Why wouldn't you include the headers explicitly? It gets done anyway.
 
Old 01-26-2004, 03:43 PM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,386

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
you really shouldn't approach problems in this direction... you are clearly not using the language correctly, but you still want to fight it??
 
Old 01-26-2004, 03:43 PM   #4
h/w
Senior Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Debian Testing
Posts: 1,286

Original Poster
Rep: Reputation: 45
hmm .. yeah.
well, was just wondering.
thanks.
 
Old 01-26-2004, 03:45 PM   #5
coolman0stress
Member
 
Registered: Jun 2003
Location: Toronto, Ontario, Canada
Posts: 288

Rep: Reputation: 30
what compiler are you using? I'm sure there is a way to supress warnings.

But like Strike mentioned, just include the headers.
 
Old 01-26-2004, 03:45 PM   #6
h/w
Senior Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Debian Testing
Posts: 1,286

Original Poster
Rep: Reputation: 45
gcc 3.
yeah, it's ok. was just wondering - that's all.
 
Old 01-26-2004, 05:06 PM   #7
jim mcnamara
Member
 
Registered: May 2002
Posts: 964

Rep: Reputation: 34
The answer is: extern int printf

But it isn't a good answer. If you ever read the /usr/include/nnn.h files you'll see why. There are all kinds of things that are declared different ways in different environments. eg., as macros vs functions or as float vs double.

All of this could become a problem for you running your code.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting 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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Warnings from make Conjurer Linux - Software 1 11-12-2005 02:10 AM
Need help with java warnings Hockeyfan Programming 1 07-22-2005 02:01 PM
Synaptic warnings snowy MEPIS 6 07-08-2005 03:40 AM
What do these warnings mean (re cdrom)? tigerflag Linux - Hardware 4 03-24-2005 06:14 PM
Removing files wihtout removing containing Direcotry caps_phisto Linux - General 2 10-07-2004 08:16 AM


All times are GMT -5. The time now is 01:58 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration