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


Groups > comp.lang.c > #71774

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

From Melzzzzz <mel@zzzzz.com>
Newsgroups comp.lang.c
Subject Re: Making sense of warning about "initialization makes pointer from integer without a cast"
Date 2015-10-04 05:08 +0200
Organization albasani.net
Message-ID <20151004050802.0035ea4f@maxa-pc> (permalink)
References <muq3ie$6bc$1@speranza.aioe.org>

Show all headers | View raw


On Sun, 4 Oct 2015 04:40:38 +0200
"Morten W. Petersen" <morphex@gmail.com> wrote:

> Hi there.
> 
> In my project Smash XML, I'm getting a warning of an incompatible
> pointer type (version getting the error is here):
> 
> https://github.com/morphex/smash_xml/tree/d381c7e596769dbcf6f2c0811f0f3cfd59bb8709
> 
> And the error is this:
> 
> $ make
> gcc -std=c90 -Wall -Wno-implicit-function-declaration decode_xml.c 
> tests.c -g -o decode_xml -I.
> tests.c: In function `main':
> tests.c:228:34: warning: initialization makes pointer from integer 
> without a cast
>       struct xml_element *result = parse_file(file);
> 
> The function definition parse_file says that it will return a pointer,
> it also does in the function.
> 
> What's wrong here?
> 
> -Morten

You don't have headers? Your function is implicitly declared, therefore
it returns int. You'll get crash as int is usually 4 bytes and pointer
8 bytes on 64 bit system...

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