Hi everyone,
I'm currently struggling to compile a large piece of legacy code. GCC
3.3 compiles it without complaining, but GCC 4.2.3 (the default in
Debian) refuses it and signals "several array has incomplete element
type" errors.
I know that since 4.0 or so, GCC is less forgiving and does not accept
any arrays of incomplete type (see http://gcc.gnu.org/ml/gcc/2005-02/msg00053.html).
However, I cannot see where the array types are incomplete here:
/* From the header */
void grphcs_enhnc_outsquare(unsigned char [][], const int, const int,
const int, const int y);
/* From the source: ERROR: Array type has incomplete element type */
void grphcs_enhnc_outsquare(unsigned char outsquare[][], const int w,
const int h, const int x, const int y)
{ /* ... */ }
/* From another header */
extern void bz_comp(int, int [], int [], int [], int *, int [][], int
*[]);
/* From the corresponding source: ERROR: Array type has incomplete
element type */
void bz_comp(
int npoints,
int xcol[ MAX_BOZORTH_MINUTIAE ],
int ycol[ MAX_BOZORTH_MINUTIAE ],
int thetacol[ MAX_BOZORTH_MINUTIAE ],
int * ncomparisons,
int cols[][ COLS_SIZE_2 ],
int * colptrs[]
)
{ /* ... */ }
Can anyone shed some light?
Thanks in advance
- Arcadio 10 7589
In comp.lang.c, arcadio wrote:
Hi everyone,
I'm currently struggling to compile a large piece of legacy code. GCC
3.3 compiles it without complaining, but GCC 4.2.3 (the default in
Debian) refuses it and signals "several array has incomplete element
type" errors.
[snip]
/* From the corresponding source: ERROR: Array type has incomplete
element type */
void bz_comp(
int npoints,
int xcol[ MAX_BOZORTH_MINUTIAE ],
int ycol[ MAX_BOZORTH_MINUTIAE ],
int thetacol[ MAX_BOZORTH_MINUTIAE ],
int * ncomparisons,
int cols[][ COLS_SIZE_2 ],
How many cols elements are in this array? How can the compiler determine
that number?
int * colptrs[]
)
{ /* ... */ }
Can anyone shed some light?
Thanks in advance
- Arcadio
--
Lew Pitcher
Master Codewright & JOAT-in-training | Registered Linux User #112576 http://pitcher.digitalfreehold.ca/ | GPG public key available by request
---------- Slackware - Because I know what I'm doing. ------
arcadio said:
<snip>
However, I cannot see
where the array types are incomplete here:
/* From the header */
void grphcs_enhnc_outsquare(unsigned char [][]
^^^^
Right here.
Regarding your subject line, "Array has incomplete element type. GCC bug?",
it is generally wisest in the first instance[1] to assume that the bug is
in your code unless you can demonstrate from the Standard that your code
is correct.
[1]...and the second instance, and the third...
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
arcadio wrote:
Hi everyone,
I'm currently struggling to compile a large piece of legacy code. GCC
3.3 compiles it without complaining, but GCC 4.2.3 (the default in
Debian) refuses it and signals "several array has incomplete element
type" errors.
I know that since 4.0 or so, GCC is less forgiving and does not accept
any arrays of incomplete type (see http://gcc.gnu.org/ml/gcc/2005-02/msg00053.html).
However, I cannot see where the array types are incomplete here:
/* From the header */
void grphcs_enhnc_outsquare(unsigned char [][], const int, const int,
const int, const int y);
/* From the source: ERROR: Array type has incomplete element type */
void grphcs_enhnc_outsquare(unsigned char outsquare[][], const int w,
const int h, const int x, const int y)
{ /* ... */ }
/* From another header */
extern void bz_comp(int, int [], int [], int [], int *, int [][], int
*[]);
/* From the corresponding source: ERROR: Array type has incomplete
element type */
void bz_comp(
int npoints,
int xcol[ MAX_BOZORTH_MINUTIAE ],
int ycol[ MAX_BOZORTH_MINUTIAE ],
int thetacol[ MAX_BOZORTH_MINUTIAE ],
int * ncomparisons,
int cols[][ COLS_SIZE_2 ],
int * colptrs[]
)
{ /* ... */ }
Can anyone shed some light?
Thanks in advance
extern void
bz_comp(int, int [], int [], int [], int *,
int [][COLS_SIZE_2], int *[]);
--
pete
On 23 jun, 17:59, Lew Pitcher <lpitc...@teksavvy.comwrote:
In comp.lang.c, arcadio wrote:
Hi everyone,
I'm currently struggling to compile a large piece of legacy code. GCC
3.3 compiles it without complaining, but GCC 4.2.3 (the default in
Debian) refuses it and signals "several array has incomplete element
type" errors.
[snip]
/* From the corresponding source: ERROR: Array type has incomplete
element type */
void bz_comp(
int npoints,
int xcol[ * * MAX_BOZORTH_MINUTIAE ],
int ycol[ * * MAX_BOZORTH_MINUTIAE ],
int thetacol[ MAX_BOZORTH_MINUTIAE ],
int * ncomparisons,
int cols[][ COLS_SIZE_2 ],
How many cols elements are in this array? How can the compiler determine
that number?
int * colptrs[]
)
{ /* ... */ }
Can anyone shed some light?
Thanks in advance
- Arcadio
--
Lew Pitcher
Master Codewright & JOAT-in-training | Registered Linux User #112576http://pitcher.digitalfreehold.ca/* | GPG public key available by request
---------- * * *Slackware - Because I know what I'm doing. * * * * *------
The error is not there, it's:
/* From the header */
void grphcs_enhnc_outsquare(unsigned char **, const int, const int,
<-- transform into pointers
const int, const int y);
/* From the source: ERROR: Array type has incomplete element type */
void grphcs_enhnc_outsquare(unsigned char **outsquare, const int w,
<-- transform into pointers
const int h, const int x, const int y)
{ /* ... */ }
/* From another header */
extern void bz_comp(int, int [], int [], int [], int *, int []
[COLS_SIZE_2], int <- constant needed
*[]);
/* From the corresponding source: ERROR: Array type has incomplete
element type */
void bz_comp(
int npoints,
int xcol[ MAX_BOZORTH_MINUTIAE ],
int ycol[ MAX_BOZORTH_MINUTIAE ],
int thetacol[ MAX_BOZORTH_MINUTIAE ],
int * ncomparisons,
int cols[][ COLS_SIZE_2 ],
int * colptrs[]
)
{ /* ... */ }
In article <6d******************************@bt.com>,
Richard Heathfield <rj*@see.sig.invalidwrote:
>arcadio said:
<snip>
>However, I cannot see where the array types are incomplete here:
/* From the header */ void grphcs_enhnc_outsquare(unsigned char [][]
^^^^ Right here.
Regarding your subject line, "Array has incomplete element type. GCC bug?", it is generally wisest in the first instance[1] to assume that the bug is in your code unless you can demonstrate from the Standard that your code is correct.
While I agree with the sentiment here (including the footnote(s)), the
salient fact here is that OP says it worked (compiled) with the earlier
versions of GCC. Now, assuming he isn't mistaken about that, the fact
is that you can standards-jockey it all you want, it ain't gonna mean
much. Believe me, if TPTB (the ones who are paying the bills) know that
it worked before and it doesn't work now, then, for all practical
purposes, it is a bug (in the new version) - and no amount of
standards-jockeying is going to change that fact.
Or, to put it a little bit more charitably, OP's post can (and should)
be interpreted as: It worked before; it doesn't work now; is there a
workaround?
On Mon, 23 Jun 2008 19:17:17 +0000, Kenny McCormack wrote:
In article <6d******************************@bt.com>, Richard Heathfield
<rj*@see.sig.invalidwrote:
>>arcadio said:
<snip>
>>However, I cannot see where the array types are incomplete here:
/* From the header */ void grphcs_enhnc_outsquare(unsigned char [][]
^^^^ Right here.
[...]
Or, to put it a little bit more charitably, OP's post can (and should)
be interpreted as: It worked before; it doesn't work now; is there a
workaround?
Sure: declare a pointer to an array of unsigned char of unknown length.
void grphcs_enhnc_outsquare(unsigned char (*)[], ...);
void grphcs_enhnc_outsquare(unsigned char (*outsquare)[], ...) {
...
}
This is what the declaration meant with those older versions of GCC, and
what it would mean in standard C if it weren't specifically disallowed,
anyway.
I'd be surprised to find a sensible use for this type of declaration,
though. It's valid and compiles, but all the other problems of
unsigned char [][] remain, so it would still be good to find a better type
to use.
In article <6c*************@mid.individual.net>, bl****@myrealbox.com <bl****@myrealbox.comwrote:
>In article <86**********************************@k37g2000hsf. googlegroups.com>, arcadio <ar****************@gmail.comwrote:
>Thanks, I was quite obfuscated
>Point of English usage: Can one speak of a person being obfuscated,
Yes. OED has a secondary meaning that makes it clear that it can
apply to a person:
2. Of a person or his or her faculties: confused, bewildered;
amazed, flabbergasted (obs.); (U.S. slang) spec. befuddled with
alcohol, intoxicated (now rare).
There are a few examples given, such as
1860 `G. ELIOT' Mill on Floss I. I. vii. 125 As for uncle Pullet, he
could hardly have been more thoroughly obfuscated if Mr Tulliver had
said that he was going to send Tom to the Lord Chancellor.
--
"[i]t lacks context, and may or may not make sense."
-- Walter J. Phillips
In article <g3**********@canopus.cc.umanitoba.ca>,
Walter Roberson <ro******@ibd.nrc-cnrc.gc.cawrote:
In article <6c*************@mid.individual.net>, bl****@myrealbox.com <bl****@myrealbox.comwrote:
In article <86**********************************@k37g2000hsf. googlegroups.com>,
arcadio <ar****************@gmail.comwrote:
Thanks, I was quite obfuscated
Point of English usage: Can one speak of a person being
obfuscated,
Yes. OED has a secondary meaning that makes it clear that it can
apply to a person:
2. Of a person or his or her faculties: confused, bewildered;
amazed, flabbergasted (obs.); (U.S. slang) spec. befuddled with
alcohol, intoxicated (now rare).
There are a few examples given, such as
1860 `G. ELIOT' Mill on Floss I. I. vii. 125 As for uncle Pullet, he
could hardly have been more thoroughly obfuscated if Mr Tulliver had
said that he was going to send Tom to the Lord Chancellor.
--
"[i]t lacks context, and may or may not make sense."
-- Walter J. Phillips
Huh! The entry in the online Merriam-Webster http://www.merriam-webster.com/dictionary/obfuscated
doesn't seem to give this meaning. But okay, I've learned
something!
(If it matters, my post was meant to be possibly-useful information
for someone for whom English might not be a first language. But
maybe he(?) knows it better than I do. Sort of a :-). )
--
B. L. Massingill
ObDisclaimer: I don't speak for my employers; they return the favor. bl****@myrealbox.com said:
In article <g3**********@canopus.cc.umanitoba.ca>,
Walter Roberson <ro******@ibd.nrc-cnrc.gc.cawrote:
>In article <6c*************@mid.individual.net>, bl****@myrealbox.com <bl****@myrealbox.comwrote:
<snip>
>Point of English usage: Can one speak of a person being obfuscated,
Yes. OED has a secondary meaning that makes it clear that it can apply to a person:
[...]
>
Huh! The entry in the online Merriam-Webster
http://www.merriam-webster.com/dictionary/obfuscated
doesn't seem to give this meaning. But okay, I've learned
something!
Yes, you've learned that you get the dictionary you pay for. :-)
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
In article <4Y******************************@bt.com>,
Richard Heathfield <rj*@see.sig.invalidwrote:
bl****@myrealbox.com said:
In article <g3**********@canopus.cc.umanitoba.ca>,
Walter Roberson <ro******@ibd.nrc-cnrc.gc.cawrote:
In article <6c*************@mid.individual.net>, bl****@myrealbox.com <bl****@myrealbox.comwrote:
<snip>
Point of English usage: Can one speak of a person being
obfuscated,
Yes. OED has a secondary meaning that makes it clear that it can
apply to a person:
[ .... ]
Huh! The entry in the online Merriam-Webster http://www.merriam-webster.com/dictionary/obfuscated
doesn't seem to give this meaning. But okay, I've learned
something!
Yes, you've learned that you get the dictionary you pay for. :-)
:-), yes, but --
It might also have to do with the two dictionaries just
having different slants in general. I haven't done a thorough
comparison, but my impression based on a few other experiences
using both dictionaries is that the OED is somewhat more
traditional/prescriptivist than Merriam-Webster, and that there
also may be {left/right}-pondian differences.
I believe it's time to change the subject line from "semi-OT"
to "OT", as well as just letting this go ....
--
B. L. Massingill
ObDisclaimer: I don't speak for my employers; they return the favor. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Paul F. Dietz |
last post by:
Is the following legal C?
struct foo;
struct foo (*p); /* Pointer to array of 10 foo structures */
struct foo { int bar; int baz; };
main() { printf("%d\n", sizeof(*p)); }
Paul Dietz...
|
by: Eric Smith |
last post by:
Is a structure containing an incomplete array as its last element (per
paragraph 2 of section 6.7.2.1 of ISO/IEC 9899:1999 (E)) itself an
incomplete type? That appears to be indicated by paragraph...
|
by: Neo |
last post by:
Hi Folks,
#include<stdio.h>
int main()
{
int (*p);
int arr;
int i;
|
by: Adam Warner |
last post by:
Hi all,
With this structure that records the length of an array of pointers as its
first member:
struct array {
ptrdiff_t length;
void *ptr;
};
|
by: Alexei A. Frounze |
last post by:
Hi all,
I have a question regarding the gcc behavior (gcc version 3.3.4).
On the following test program it emits a warning:
#include <stdio.h>
int aInt2 = {0,1,2,4,9,16};
int aInt3 =...
|
by: rupesh_533 |
last post by:
I am assuming the following things.
1.Pointer to an integer means it points to an integer,On incrementing
the pointer,it points to the next integer in memory.
2.Pointer to an array of some size...
|
by: Adam Warner |
last post by:
Hi all,
One cannot return a pointer to an array type in C because C has no first
class array types. But one can return a pointer to a struct containing an
incomplete array via the illegal but...
|
by: Hallvard B Furuseth |
last post by:
to find the required alignment of a struct, I've used
#include <stddef.h>
struct Align_helper {
char dummy;
struct S align;
};
enum { S_alignment = offsetof(struct Align_helper, align) };
|
by: walex |
last post by:
Hello guys, I'm trying to install devsec an application for ffpeg for camera,but on,is a c programme,after compilation ,i now type make, then this two error are generated.common.h:67: error: array...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |