🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c.moderated
Article #2581

Re: include file checking

#2581
From: Dan Pop
Date: Sat, 13 Apr 1996 02:27
51 lines
2121 bytes
In <4kll8t$o4r@solutions.solon.com> kgold@watson.ibm.com (K Goldman) writes:

>schwab@lamothe.informatik.uni-dortmund.de (Andreas Schwab) writes:
>|> kgold@watson.ibm.com (K Goldman) writes:
>|> 
>|> |> My compiler seems to check function prototypes if they exist, but
>|> |> is just as happy to not have them.  Therefore . . .
>|> 
>|> |> Is there an automated way to insure that I have included all the
>|> |> header files that I need in my source code?
>|> 
>|> You don't say which compiler you use, but if you use GCC you can
>|> enable -Wmissing-prototypes, -Wstrict-prototypes,
>|> -Wmissing-declarations, and/or -Wimplicit, depending on what you want
>|> to check for.
>|> 
>
>Sorry.  It's xlc, which is the ANSI version of cc, on an IBM RS/6000
>running AIX 3.2.5.
>
>I _did_ read the manual, and the man page, and the on-line help,
>and there doesn't seem to be a switch to check for prototypes.

Two possibilities:

1. Upgrade to AIX 4.1 and the current version of xlc, which does what you
   need:

    sp054:~/tmp 9> cat test.c
    void foo(void)
    {
	bogus();
    }
    sp054:~/tmp 10> xlc -qinfo -c test.c
    "test.c", line 3.5: 1506-304 (I) No function prototype given for 'bogus'.

2. Use gcc, which is freeware:

    sp054:~/tmp 11> gcc -Wall -c test.c
    test.c: In function `foo':
    test.c:3: warning: implicit declaration of function `bogus'

Given your email address, the first alternative might be free for you,
as well.

Dan
--
Dan Pop
CERN, CN Division
Email: danpop@mail.cern.ch 
Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
Technical Details
Message-ID: <4kn3dm$3nd@solutions.solon.com>
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
References: <4khl1h$stq@solutions.solon.com> <4kjkh7$bo6@solutions.solon.com> <4kll8t$o4r@solutions.solon.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
From: danpop@mail.cern.ch (Dan Pop)
Newsgroups: comp.lang.c.moderated
Subject: Re: include file checking
Date: 12 Apr 1996 21:27:02 -0500
Organization: CERN European Lab for Particle Physics
Sender: clc@solutions.solon.com
Approved: clc@solutions.solon.com
Message-ID: <4kn3dm$3nd@solutions.solon.com>
References: <4khl1h$stq@solutions.solon.com> <4kjkh7$bo6@solutions.solon.com> <4kll8t$o4r@solutions.solon.com>
NNTP-Posting-Host: solutions.solon.com