Question about genassym, locore.s and 0-sized
arrays(showstopper for an icc compiled kernel)
Alexander Leidinger
Alexander at Leidinger.net
Sat Sep 6 01:32:19 PDT 2003
On Fri, 5 Sep 2003 09:55:57 -0700
Marcel Moolenaar <marcel at xcllnt.net> wrote:
> Interesting, What does icc do with:
>
> struct {
> int tag;
> char obj[];
> } foo;
>
> And what does the sizeof() operator give.
---snip---
% <marcel.c
#include <stdio.h>
struct {
int tag;
char obj[];
} foo;
int main(void) {
struct foo bar;
printf("%d\n", sizeof(struct foo));
printf("%d\n", sizeof(bar));
return 0;
}
% icc marcel.c
marcel.c(9): error: incomplete type is not allowed
struct foo bar;
^
marcel.c(11): warning #70: incomplete type is not allowed
printf("%d\n", sizeof(struct foo));
^
compilation aborted for marcel.c (code 2)
% <marcel.c
#include <stdio.h>
struct {
int tag;
char obj[];
} foo;
int main(void) {
printf("%d\n", sizeof(struct foo));
return 0;
}
% icc marcel.c
marcel.c(9): warning #70: incomplete type is not allowed
printf("%d\n", sizeof(struct foo));
^
% ./a.out
0
---snip---
Bye,
Alexander.
--
Loose bits sink chips.
http://www.Leidinger.net Alexander @ Leidinger.net
GPG fingerprint = C518 BC70 E67F 143F BE91 3365 79E2 9C60 B006 3FE7
More information about the freebsd-current
mailing list