Note that there are some explanatory texts on larger screens.

plurals
  1. POC function pointers error storage class specified for parameter `type name'
    primarykey
    data
    text
    <p>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:</p> <pre><code>error_t addCommand(uint8_t command, void (*callback)(uint16_t,uint8_t)){ </code></pre> <p>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:</p> <ol> <li>Something wrong in a header (missing semicolon)</li> <li>Passing a function pointer with a static or volatile value (i.e. <code>void (*callback)(volatile int, uint8_t)</code></li> </ol> <p>I have eliminated problem 1 as far as I can tell. Problem 2 is only an issue if <code>uint16_t</code> or <code>uint8_t</code> 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.</p> <p>Also, if anyone is familiar with nesC the exact code looks more like this:</p> <pre><code>command error_t CommandEngine.addCommand(uint8_t command, void (*callback)(uint16_t,uint8_t)) { </code></pre> <p>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.</p> <p>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.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload