🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #52194

Unclear GCC Warning: Implicit Declaration !?

#52194
From: Markus Lautenbacher
Date: Mon, 18 Jan 1993 10:07
33 lines
1594 bytes
Hi there,

if I compile the following simple program

--------
#include <stdio.h>

int main ()
{
    printf("Hello world !\n");
    return 0;
}
--------
with "gcc -Wall -target sun4 -o w w.c" using gcc-2.3.3 on a Sun
SPARCstation 1+ running SunOS 4.1.1, I get
--------
w.c: In function `main':
w.c:5: warning: implicit declaration of function `printf'
--------

I thought by writing "#include <stdio.h>" I have already taken care of
the proper declaration of printf() !?
Any hints whether I have missed something or whether gcc is incorrect
here are welcome. Should I care about the warning at all ?

Thanx in advance,
                 MARKUS 
--
MARKUS E. LAUTENBACHER,         | phone: +49/89/3209-2387
Technical University Munich,    | fax:   +49/89/32092296
Physics Dept.-Theo. Physics T31,| Internet:
D-8046 Garching, FRG.           | lauten@feynman.t30.physik.tu-muenchen.de
Technical Details
Message-ID: <lauten.727351645@Physik.TU-Muenchen.DE>
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!yale.edu!ira.uka.de!math.fu-berlin.de!informatik.tu-muenchen.de!lrz-muenchen.de!lauten

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,37e0aabd747ee6ab,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-01-19 01:16:16 PST
Newsgroups: gnu.gcc.help
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!yale.edu!ira.uka.de!math.fu-berlin.de!informatik.tu-muenchen.de!lrz-muenchen.de!lauten
From: lauten@Physik.TU-Muenchen.DE (Markus Lautenbacher)
Subject: Unclear GCC Warning: Implicit Declaration !?
Message-ID: <lauten.727351645@Physik.TU-Muenchen.DE>
Keywords: printf implicit declaration
Sender: news@news.lrz-muenchen.de (Mr. News)
Organization: Leibniz-Rechenzentrum, Muenchen (Germany)
Date: Mon, 18 Jan 1993 10:07:25 GMT
Lines: 33