#375 functional vars

closed-rejected
nobody
None
5
2003-01-07
2002-08-25
No

void func (void) {} ;

int main(void)
{
void (*fvar)(void);

fvar = func;
fvar(); /* this line giver error: too many parameters */

/* i have to call like this */
(*fvar)()
}

/*

I'm compiling for Z80, but I think I tried for the mcs51 as
well
TIA!

*/

Discussion

  • Bernhard Held

    Bernhard Held - 2002-08-25

    Logged In: YES
    user_id=203539

    The source in the initial comment doesn't show the bug.
    The bug is exposed in:

    #define NULL 0
    void func (void *x) reentrant;

    int main(void)
    {
    void (*fvar)(void *arg) reentrant;

    fvar = func;
    fvar (NULL); /* this line giver error: too many parameters */
    (*fvar) (NULL); /* i have to call like this */
    }

     
  • Johan Knol

    Johan Knol - 2003-01-07
    • status: open --> closed-rejected
     
  • Johan Knol

    Johan Knol - 2003-01-07

    Logged In: YES
    user_id=63512

    which is as documented

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks