From: Patrick <patrickC@puzzled.xs4all.nl>
To: linux-c-programming@vger.kernel.org
Subject: assignment makes pointer from integer without a cast?
Date: Mon, 13 Dec 2004 01:52:39 +0100 [thread overview]
Message-ID: <1102899159.7251.14.camel@guru.puzzled.xs4all.nl> (raw)
Hello,
New to the list and to C. Read O'Reilly's Practical C Programming and
another C book and am now trying to evolve beyond helloworld.c. When I
compile the snippet below, gcc-3.4.2 on Fedora Core 3 spits out:
test2.c:11: warning: assignment makes pointer from integer without a
cast
test2.c:12: warning: passing arg 1 of `usage' from incompatible pointer
type
I just can't figure out why it does that and how to fix it since my
pointer/casting/C knowledge is definitely lacking. The snippet does work
ok. Anyone care to enlighten me?
#include <stdio.h>
void usage(int *prog_ptr)
{
fprintf(stdout,"progname is: %s\n",*prog_ptr);
}
int main(int argc, char *argv[])
{
int *prog_ptr;
prog_ptr = basename (argv[0]);
usage(&prog_ptr);
return(0);
}
TIA,
Patrick
next reply other threads:[~2004-12-13 0:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-13 0:52 Patrick [this message]
2004-12-13 1:47 ` assignment makes pointer from integer without a cast? Hossein Mobahi
2004-12-13 16:13 ` Francesco Gadaleta
2004-12-13 19:53 ` Jan-Benedict Glaw
2004-12-16 2:07 ` how to link mqueue library Ron Michael Khu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1102899159.7251.14.camel@guru.puzzled.xs4all.nl \
--to=patrickc@puzzled.xs4all.nl \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).