Thread: static is invalid storage class

  1. #1
    Registered User
    Join Date
    Oct 2015
    Posts
    1

    static is invalid storage class

    I'm writing a kernel module for work and they recently asked me to port it to an older version of the kernel so that it could run on some of our systems (2.6.18). Well a lot of things in 2.6.32 don't exist in 2.6.18 and the only way I could think of that could fix it and work (since backporting was not an option to us) is to create a header and c file in my module that contains all the functions, structs, and global variables from the .32 kernel. It was working fine up until I had to add
    Code:
    static inline struct crypto_tfm *crypto_blkcipher_tfm(struct crypto_blkcipher *tfm){....}
    .
    I go the error that the function was an invalid storage class and when I removed the static inline part it was fine. But now its complaining that all the static functions that we originally created are also invalid storage classes. Why is it doing this? Is there any way to fix it other than removing all of the "static" keywords?

  2. #2
    Registered User Ktulu's Avatar
    Join Date
    Oct 2006
    Posts
    107
    With MVC++ I have to declare as such: static __inline ...

    "Microsoft Visual C++ and few other compilers support non-standard constructs for defining inline functions, such as __inline and __forceinline specifiers."
    This parameter is reserved

  3. #3
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    Is it possible that the compiler on the "older" system doesn't support the inline keyword?
    What can this strange device be?
    When I touch it, it gives forth a sound
    It's got wires that vibrate and give music
    What can this thing be that I found?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Invalid storage class for a function.
    By Liangine in forum C++ Programming
    Replies: 1
    Last Post: 03-23-2014, 07:05 PM
  2. Need help: Explanation of a static storage class
    By Sam Pertuit in forum C Programming
    Replies: 7
    Last Post: 01-30-2013, 09:34 AM
  3. Invalid storage class for function
    By InicDominus in forum C Programming
    Replies: 9
    Last Post: 10-15-2012, 11:51 AM
  4. Doubt regarding storage of a static variable
    By karthik537 in forum C Programming
    Replies: 6
    Last Post: 02-21-2012, 01:21 PM
  5. static storage class
    By roaan in forum C Programming
    Replies: 4
    Last Post: 09-08-2009, 04:57 PM

Tags for this Thread