Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7947875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:33:25+00:00 2026-06-04T01:33:25+00:00

I currently have a piece of code that I am working on using function

  • 0

I currently have a piece of code that I am working on using function pointers as callbacks. I am having trouble with an error from gcc stating “storage class specified for parameter `type name'” The relevant portion of code is:

error_t addCommand(uint8_t command, void  (*callback)(uint16_t,uint8_t)){

This is actually using the nesC language for TinyOS but it seems to be a C issue. In my research on the issue I have found suggestions mostly stemming from one of two issues:

  1. Something wrong in a header (missing semicolon)
  2. Passing a function pointer with a static or volatile value (i.e. void (*callback)(volatile int, uint8_t)

I have eliminated problem 1 as far as I can tell. Problem 2 is only an issue if uint16_t or uint8_t are static of volatile (I don’t have much experience with these types). Any tips/answers on how to solve this issue are greatly appreciated.

Also, if anyone is familiar with nesC the exact code looks more like this:

command error_t CommandEngine.addCommand(uint8_t command,
                                         void  (*callback)(uint16_t,uint8_t)) {

It may be possible that what nesC is adding to the C language causes this error but I don’t think this is the case.

EDIT: It was nesC, in a way. It turns out that I’m a moron and was using command as a variable name when command is used by nesC and converted to some block of C code before compilation. Thanks everyone for the idea of converting it to C code as this caused me to realize the issue. I really should have thought of this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T01:33:26+00:00Added an answer on June 4, 2026 at 1:33 am

    It’s generally good to use typedefs for function pointers. It may solve your problem, and will surely be much more readable:

    typedef void (*callback_t)(uint16_t,uint8_t);
    error_t addCommand(uint8_t command, callback_t callback)){
    

    If it won’t solve the problem, it will at least narrow it down – you’ll see if the problem is with the typedef or the function.

    You should also try to figure out if it’s nesC (which I know nothing about) or C. Try to remove nesC specific parts and compile with gcc, and see what happens.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently I have a piece of code that works fine as long as there
I am working on a piece of code that writes data from 4 different
So I'm working on some HTML5 code using HAML and SASS. I currently have
I currently have this piece of code: NSString *strURL = [NSString stringWithFormat:@http://www.sample.com /phpFile.php?firstname=%@,txtfirstName.text]; NSString
I am currently working a piece of code which needs to send an attachment
Let's say you are working on a piece of legacy code that was written
I'm currently working on some performance critical code, and I have a particular situation
I'm having a small bit of trouble trying to get this piece of code
I have a piece of code that attempts to acquire the credentials for a
I have found this piece of code in the Haskell sendfile package: http://patch-tag.com/r/mae/sendfile/snapshot/current/content/pretty/src/Network/Socket/SendFile/Linux.hsc --

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.