From: "J.A. Magallon" <jamagallon@able.es>
To: Lista Linux-Kernel <linux-kernel@vger.kernel.org>
Subject: bad function ptrs - is it dangerous ?
Date: Wed, 2 Oct 2002 00:51:25 +0200 [thread overview]
Message-ID: <20021001225125.GD3927@werewolf.able.es> (raw)
Hi al...
I have a little question. Let's suppose you have this:
int (*pf)(data *);
int f(data*);
so you can:
pf = f;
pf(data).
Fine. But what happens if:
void (*pf)(data *);
int f(data*);
pf = f; // gcc happily swallows, gcc-3.2 gives a warning.
pf(data).
??
In C calling convention, the callee kills the stack so nothing should
happen... or it should ?
The (in)famous graphics driver all you know is doing this with the
copy_info op for gart...
TIA
--
J.A. Magallon <jamagallon@able.es> \ Software is like sex:
werewolf.able.es \ It's better when it's free
Mandrake Linux release 9.0 (dolphin) for i586
Linux 2.4.20-pre8-jam1 (gcc 3.2 (Mandrake Linux 9.0 3.2-1mdk))
next reply other threads:[~2002-10-01 22:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-01 22:51 J.A. Magallon [this message]
2002-10-01 23:56 ` bad function ptrs - is it dangerous ? Burton Samograd
2002-10-02 8:06 Mikael Pettersson
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=20021001225125.GD3927@werewolf.able.es \
--to=jamagallon@able.es \
--cc=linux-kernel@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).