Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #71873

Re: Making sense of warning about "initialization makes pointer from integer without a cast"

From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: Making sense of warning about "initialization makes pointer from integer without a cast"
Date 2015-10-04 15:10 -0700
Organization None to speak of
Message-ID <lna8ryxp1t.fsf@kst-u.example.com> (permalink)
References <muq3ie$6bc$1@speranza.aioe.org> <muq5i6$env$1@dont-email.me> <muq62o$9up$1@speranza.aioe.org>

Show all headers | View raw


"Morten W. Petersen" <morphex@gmail.com> writes:
> On 04.10.2015 05:16, James Kuyper wrote:
[...]
>> Note: this is a mis-feature of C90, which is why it was corrected in
>> C99. In C99, the wording that required creation of the implicit
>> declaration was dropped - if you don't have an explicit function
>> declaration in scope, the identifier for the function doesn't have any
>> declared type associated with it, violating the constraint in 6.5.5.2p1.
>
> Wow, OK.  So I'll need to generate a header file with functions
> declarations automatically then.

You'll need to generate a header file with function declarations
(specifically prototypes).  (Strictly speaking you don't *have*
to have a header file, but there's no good reason not to.)

Whether you do it automatically is up to you.

(Personally I'd copy the .c file to the .h file, then manually
edit it by adding include guards and deleting the function bodies.
On the other hand, I'd be more likely to have the .h file without
the .c file in the first place than vice versa.)

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Making sense of warning about "initialization makes pointer from integer without a cast" "Morten W. Petersen" <morphex@gmail.com> - 2015-10-04 04:40 +0200
  Re: Making sense of warning about "initialization makes pointer from integer without a cast" "Morten W. Petersen" <morphex@gmail.com> - 2015-10-04 04:59 +0200
    Re: Making sense of warning about "initialization makes pointer from integer without a cast" James Kuyper <jameskuyper@verizon.net> - 2015-10-03 23:23 -0400
    Re: Making sense of warning about "initialization makes pointer from integer without a cast" Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-10-04 13:47 +0100
      Re: Making sense of warning about "initialization makes pointer from integer without a cast" Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-10-04 09:40 -0400
        Re: Making sense of warning about "initialization makes pointer from integer without a cast" "Morten W. Petersen" <morphex@gmail.com> - 2015-10-05 00:33 +0200
          Re: Making sense of warning about "initialization makes pointer from integer without a cast" James Kuyper <jameskuyper@verizon.net> - 2015-10-04 19:07 -0400
  Re: Making sense of warning about "initialization makes pointer from integer without a cast" Melzzzzz <mel@zzzzz.com> - 2015-10-04 05:08 +0200
  Re: Making sense of warning about "initialization makes pointer from integer without a cast" James Kuyper <jameskuyper@verizon.net> - 2015-10-03 23:16 -0400
    Re: Making sense of warning about "initialization makes pointer from integer without a cast" "Morten W. Petersen" <morphex@gmail.com> - 2015-10-04 05:23 +0200
      Re: Making sense of warning about "initialization makes pointer from integer without a cast" James Kuyper <jameskuyper@verizon.net> - 2015-10-03 23:34 -0400
        Re: Making sense of warning about "initialization makes pointer from integer without a cast" "Morten W. Petersen" <morphex@gmail.com> - 2015-10-04 05:50 +0200
          Re: Making sense of warning about "initialization makes pointer from integer without a cast" James Kuyper <jameskuyper@verizon.net> - 2015-10-04 13:49 -0400
            Re: Making sense of warning about "initialization makes pointer from integer without a cast" Richard Heathfield <rjh@cpax.org.uk> - 2015-10-04 19:11 +0100
              Re: Making sense of warning about "initialization makes pointer from integer without a cast" James Kuyper <jameskuyper@verizon.net> - 2015-10-04 15:12 -0400
                Re: Making sense of warning about "initialization makes pointer from integer without a cast" Richard Heathfield <rjh@cpax.org.uk> - 2015-10-04 20:52 +0100
                Re: Making sense of warning about "initialization makes pointer from integer without a cast" supercat@casperkitty.com - 2015-10-04 13:18 -0700
            Re: Making sense of warning about "initialization makes pointer from integer without a cast" "Morten W. Petersen" <morphex@gmail.com> - 2015-10-05 00:26 +0200
              Re: Making sense of warning about "initialization makes pointer from integer without a cast" Keith Thompson <kst-u@mib.org> - 2015-10-04 18:09 -0700
                Re: Making sense of warning about "initialization makes pointer from integer without a cast" supercat@casperkitty.com - 2015-10-04 19:55 -0700
      Re: Making sense of warning about "initialization makes pointer from integer without a cast" Keith Thompson <kst-u@mib.org> - 2015-10-04 15:10 -0700
  Re: Making sense of warning about "initialization makes pointer from integer without a cast" Geoff <geoff@invalid.invalid> - 2015-10-03 22:04 -0700
    Re: Making sense of warning about "initialization makes pointer from integer without a cast" "Morten W. Petersen" <morphex@gmail.com> - 2015-10-04 07:07 +0200
      Re: Making sense of warning about "initialization makes pointer from integer without a cast" Geoff <geoff@invalid.invalid> - 2015-10-03 23:29 -0700
  Re: Making sense of warning about "initialization makes pointer from   integer without a cast" Ian Collins <ian-news@hotmail.com> - 2015-10-04 19:18 +1300
  Re: Making sense of warning about "initialization makes pointer from integer without a cast" Siri Cruz <chine.bleu@yahoo.com> - 2015-10-03 23:29 -0700

csiph-web