#2271 Wrong linkage of symbol declarators?

open
nobody
None
other
5
2014-04-26
2014-04-25
CG R
No

Hello, I was going through the source code and I encountered something that seems to be a problem.

Let's say I declare something like this:
int func(int (*[])(int parm));
This should be declared as: Array (any elems) of pointer to a function returning int

Per rule 'abstract_declarator -> pointer abstract_declarator2' in 'SDCC.y', the linkage happens like: pointer->next = abstract_declarator2 ($1->next = $2) resulting in 'pointer to array' and not 'array of pointer'.

I am using SDCC 3.4.0-rc2 source.

Thank you.

Discussion

  • CG R
    CG R
    2014-04-26

    Just a correction, I meant the function parameter only: 'int (*[])(int parm)'. Thank you.