Hi all,
I am compiling small program on a SPARC gcc 3.4.3

test.c
-------------------------------------------------------

struct test1
{
 int a;
 int b;
 char c;
};

struct test2
 {
 char a;
 char b;
 char c;
};

struct test3
{
 int a;
 int b;
 int c;
};

int main()
{
 struct test1* t1, t11;
 struct test2* t2 ;
 struct test3* t3;

 t1 = &t11;
 t2 = (struct t2*)t1;
 t3 = (struct t3*)t1;
 return 0;
}
--------------------------------------------------------

I suppose such an assignment should give a warning
"incompatible pointer type" but when compiling with
gcc 3.4.3 no such warning is given even with -Wall enabled.

Is this a bug in this version?

GCC version used
---------------------------
 ./cc1 --version
GNU C version 3.4.3 (sparc-elf)
        compiled by GNU C version 3.2.3 20030502 (Red Hat Linux 3.2.3-20).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072


--
Thanks,
Inder

Reply via email to