------- Additional Comments From varun0005 at gmail dot com 2005-03-31 05:05 ------- please ignore previous code and consider this piece as example ... problem is same .the exact programs are following and command line was gcc -Wall -O2 test1.c test2.c....In this why test1.c not giving warning but test2.c giving violation of strict-aliasing warning. //test1.c #include <stdio.h> #include <stdlib.h> int main() { int *i; float **q; int **r; i =(int *)malloc(sizeof(int)); r=&i; q=(float **)r; return 0; } //test2.c int main(){ int *i; float **q; i =(int *)malloc(sizeof(int)); q= (float **) &i; return 0; }
-- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20689