delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/08/13:55:46

Date: Tue, 6 Oct 1998 21:31:24 +0100 (BST)
From: George Foot <george DOT foot AT merton DOT oxford DOT ac DOT uk>
To: Uhfgood <uhfgood AT aol DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Another silly question!
In-Reply-To: <19981006122045.25193.00007641@ng117.aol.com>
Message-ID: <Pine.OSF.4.05.9810062127320.21703-100000@sable.ox.ac.uk>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

On 6 Oct 1998, Uhfgood wrote:

> Hey...  consider the following function :
> 
> jerk( )
> { 
>     printf("Bill is a jerk.\n");
> }
> 
> How come I don't get any prototyping warnings or errors when
> I compile this?  It compiles fine... no warnings or nothin'

Do you mean that you expect to get a warning about implicit
declaration of `printf' (since you didn't #include <stdio.h>) or
that you expect to get a warning about your function being
defined without a prototype?

AFAIK gcc never warns about defining a function without first
giving a prototype.  It does warn about calling an unprototyped
function before its declaration, if you turn on (almost) all
warnings by passing `-Wall'.  It will also warn that you didn't
specify a return type, and so `int' is assumed, and it will then
warn that you didn't return a value.

-- 
george DOT foot AT merton DOT oxford DOT ac DOT uk

xu do tavla fo la lojban  --  http://xiron.pc.helsinki.fi/lojban/lojban.html

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019