lkml.org 
[lkml]   [2002]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectbad function ptrs - is it dangerous ?
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))
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:29    [W:0.060 / U:0.552 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site