[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pcc-list
Subject:    Re: Solved: Error when declaring function with incomplete type parameter
From:       Jesus Sanchez <zexel_ut () hotmail ! com>
Date:       2010-07-21 8:37:36
Message-ID: BLU0-SMTP813C184C3056D35A22C032FFA10 () phx ! gbl
[Download RAW message or body]


  El 20/07/2010 18:21, Jesus Sanchez escribió:
>  - Error when declaring function with incomplete type parameter -
>
> Let's say I have a function with an incomplete type as parameter. if I
> don't specify the parameter name it's compilled but if it's specified
> then PCC returns a error.
>
> ------------------------------------------------------------------------
>
> struct point; /* forward tag declarator, this is needed */
>
> void func1 (struct point ); /* allowed by PCC */
> void func2 (struct point arg); /* error by PCC */
> ------------------------------------------------------------------------
>
> can anyone tell my if it's a bug or a C99 illegal declaration? The most
> relevant thing I found on ISO 9899:TC3 was refering to declaration
> within a function definition.
>
> 6.7.5.3
>
>    After adjustment, the parameters in a parameter type list in a
> function declarator that is part of a definition of that function shall
> not have incomplete type.
>
> regards
> -J
>

OK, solved, it's in the same section (6.7.5.3) constraint 12:

If the function declarator is not part of a definition of that function, parameters may have
incomplete type and may use the [*] notation in their sequences of declarator specifiers
to specify variable length array types.

So , i think it's allowed to have a function declarator with an
incomplete type parameter (such as struct point in the example).
I will fill a report.

thanks anyway.
-J
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic