On Fri, Oct 9, 2009 at 1:25 PM, nidhi mittal hada
<[email protected]> wrote:
> Hello i wrote a kernel module
> and when i compiled it using make
> it gave this type of errors
> where i am unable to comprehend why this storage class error is coming in
> very simple functions
>
> static int myfs_init(void)
> {
> .
> .
> .
>
> }
> static void myfs_exit(void)
> {
> .
> .
> .
> }
>
> module_init(myfs_init);
> module_exit(myfs_exit);
>
>
>
>
>
>

Can you please put the code somewhere so that we can see it?

>  error: invalid storage class for function ‘myfs_exit’
> /home/nidhi/STUDY/LINUX/LINUX_Projects/FS/MyFs4/myfs4.c:481: error: invalid
> storage class for function ‘init_myfs_inodecache’
> /home/nidhi/STUDY/LINUX/LINUX_Projects/FS/MyFs4/myfs4.c:493: error: invalid
> storage class for function ‘myfs_init’
> /home/nidhi/STUDY/LINUX/LINUX_Projects/FS/MyFs4/myfs4.c:507: error: invalid
> storage class for function ‘__inittest’
> /home/nidhi/STUDY/LINUX/LINUX_Projects/FS/MyFs4/myfs4.c:507: warning:
> ‘alias’ attribute ignored
> /home/nidhi/STUDY/LINUX/LINUX_Projects/FS/MyFs4/myfs4.c:508: error: invalid
> storage class for function ‘__exittest’
> /home/nidhi/STUDY/LINUX/LINUX_Projects/FS/MyFs4/myfs4.c:508: warning: ISO
> C90 forbids mixed declarations and code

All your variable declarations should be placed at the beginning of
their function.

> /home/nidhi/STUDY/LINUX/LINUX_Projects/FS/MyFs4/myfs4.c:508: warning:
> ‘alias’ attribute ignored
> /home/nidhi/STUDY/LINUX/LINUX_Projects/FS/MyFs4/myfs4.c:510: warning: ISO
> C90 forbids mixed declarations and code
> /home/nidhi/STUDY/LINUX/LINUX_Projects/FS/MyFs4/myfs4.c:512: error: expected
> declaration or statement at end of input
>
>
>
> can someone help in telling in which situation this error comes ?

thanks,
Daniel.

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [email protected]
Please read the FAQ at http://kernelnewbies.org/FAQ

Reply via email to