array type has incomplete element type

Discussion in 'C Programming' started by shrav4ever@gmail.com, Jan 17, 2008.

  1. Guest

    Hi All,

    --------------------------------------------------------------------------------
    This is a part of the code :
    --------------------------------------------------------------
    extern struct dummy temp[];
    error: array type has incomplete element type
    --------------------------------------------------------------
    which i compiled without any error on :
    $gcc -v
    Reading specs from /usr/bin/../lib/gcc-lib/powerpc-ibm-aix5.1.0.0
    /2.9-aix51-020209/specs
    gcc version 2.9-aix51-020209
    but the same code doesnt compile on the :

    $gcc -v
    Using built-in specs.
    Target: powerpc-ibm-aix5.3.0.0
    Configured with: ../configure --with-as=/usr/bin/as --with-ld=/usr/
    bin/
    ld
    --disable-nls --enable-languages=c,c++ --prefix=/opt/freeware
    --enable-threads --enable-version-specific-runtime-libs
    --host=powerpc-ibm-aix5.3.0.0
    Thread model: aix
    gcc version 4.0.0

    Please suggest me the arguments I must give to gcc 4.0 to get the
    above code compiled.

    Shravan
    PS : I have already gone through the article :
    <http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_047.html>.
    the code I am compiling is large and it is difficult to change it
    now.
    Please suggest me something that GCC 4.0 has for backward
    compatibility.
     
    , Jan 17, 2008
    #1
    1. Advertising

  2. Richard Bos Guest

    wrote:

    > This is a part of the code :
    > --------------------------------------------------------------
    > extern struct dummy temp[];
    > error: array type has incomplete element type
    > --------------------------------------------------------------


    > Please suggest me the arguments I must give to gcc 4.0 to get the
    > above code compiled.


    There are none. You must complete the element type of the array. IOW,
    you must define struct dummy before you declare an array of struct
    dummy. Unless you have done that, the error message is correct.

    Richard
     
    Richard Bos, Jan 17, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paul F. Dietz

    Question about incomplete array element types

    Paul F. Dietz, Jul 11, 2003, in forum: C Programming
    Replies:
    5
    Views:
    464
    Dan Pop
    Jul 11, 2003
  2. onsbomma

    has incomplete type

    onsbomma, Mar 10, 2005, in forum: C Programming
    Replies:
    3
    Views:
    797
  3. Halid Umar A M

    Error: field has incomplete type

    Halid Umar A M, Apr 27, 2006, in forum: C Programming
    Replies:
    2
    Views:
    754
    David Resnick
    Apr 27, 2006
  4. Replies:
    1
    Views:
    561
    Jim Langston
    May 2, 2007
  5. arcadio

    Array has incomplete element type. GCC bug?

    arcadio, Jun 23, 2008, in forum: C Programming
    Replies:
    11
    Views:
    2,220
Loading...

Share This Page