Re: pointer to incomplete types

From: Mitchell (cheeHATESPAMliang_at_inaHATESPAMme.coHATESPAMm)
Date: 05/15/04


Date: Sat, 15 May 2004 10:10:22 +0800

On Fri, 14 May 2004 16:54:54 +0200, Michael Birkmose
<birkmose@cs.auc.dk> wrote:

>Hi everyone!,
>
>
>Are pointers to incomplete types allowed in ANSI C?
>
<snip>
>cdecl>
>declare function (pointer to array of int, pointer to int )returning void
>Warning: Unsupported in C -- 'Pointer to array of unspecified dimension'
> (maybe you mean "pointer to object")
>void f(int (*)[], int *)

That's odd. As Ben said, it is completely legal. "[]" is allowed in
function declarations too, as stated in K&R. I tend to prefer "int *"
in declarations as "[]" confuses me to the level of indirections
especially in crazy things like "float ***".

However... shouldn't "pointer to array of int" be written as "int []"
or its equivalent "int *"? Thus the declaration cdecl returned seems
wrong! What it returned seems to me like an array of pointers to int.

Someone familiar with cdecl comment please?



Relevant Pages

  • Re: range vs precisionC
    ... volatile int a; ... in this case that is volatile. ... and we have declarations like: ... What is needed now, I think, is to realize that subtypes (and all those ad ...
    (comp.lang.c)
  • Re: K&R-Style Function Declarations: Good or Bad?
    ... > short parameters getting promoted to int. ... all pre-ANSI compilers widened char and short ... declarations -- some compilers converted the widened types back to the ...
    (comp.lang.c)
  • Re: Long(er) Factorial
    ... you declare "int num;" after several call statements. ... all declarations must precede all statements in a block. ... The format for printing a long long ...
    (comp.lang.c)
  • Re: Ommiting void
    ... easily avoid the issue by always declarating "int main". ... I do, however, also drop K&R style declarations, along with implicit ... But K&R style declarations *are* a C99 feature, ... If you don't want to support them in your compiler, that's fine, ...
    (comp.std.c)
  • Re: cout << char*
    ... "Igor Tandetnik" wrote: ... Each source file is ... Including CLib.h in library.cpp is adding the declarations to the definitions. ... int id ...
    (microsoft.public.vc.language)