lkml.org 
[lkml]   [2003]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Make `obsolete params' work correctly if MODULE_SYMBOL_PRE
From
Date
On Mon, 13 Jan 2003 15:28:45 EST, "Richard B. Johnson" said:

> void foo(int len)
> {
> char use[0x100];
> char bar[len];
> }
>
> In the case of 'use', the compiler subtracts (0x100 * sizeof(char))
> from the current stack value and uses that as the location for 'use'.
> In the case of 'bar' the compiler subtracts (len * sizeof(char))
> from the current stack value and uses that as the location for 'bar'.

One or the other of these is missing a -0x100 for the location...

void foo (int len1, unsigned int len2)
{
char bar[0x100];
char baz[len1];
char quux[len2];
char moby[8];
}

And moby[6] is *where*? ;) Bonus points for getting this right if
compiled with -fvomit-stack-pointer. <evil grin> ;)
--
Valdis Kletnieks
Computer Systems Senior Engineer
Virginia Tech

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 13:32    [W:0.043 / U:1.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site