Mail Archives: djgpp-workers/2001/06/28/05:26:23
Hi
Why does gcc allow the following? I was amazed that it allowed the
following. Very dangerous!!!
#include <stdio.h>
int i = 20 ;
int j ;
int
main (int argc, char **argv)
{
int a_i [i] ; // should not be allowed because of the danger
(traditionally use ma
lloc!)
int a_j [j] ; // very dangerous
printf ("sizeof a_i = %d\n", sizeof (a_i)) ;
printf ("sizeof a_j = %d\n", sizeof (a_j)) ;
return 0 ;
}
--
NOTICE: The information contained in this electronic mail transmission is
intended by Convergys Corporation for the use of the named individual or
entity to which it is directed and may contain information that is
privileged or otherwise confidential. If you have received this electronic
mail transmission in error, please delete it from your system without
copying or forwarding it, and notify the sender of the error by reply email
or by telephone (collect), so that the sender's address records can be
corrected.
- Raw text -