Re: a.out behavior

1999-06-06 Thread Marc Slemko
On Sun, 6 Jun 1999, Marc Tardif wrote: > The following code should obviously segfault: Nope. There is no requirement that code segfault. C does not make any promises that accessing memory that you have not allocated will do anything. > #include > #include > > char buffer[4028]; > > void ma

a.out behavior

1999-06-06 Thread Marc Tardif
The following code should obviously segfault: #include #include char buffer[4028]; void main() { int i; for (i=0; i<=4028; i++) buffer[i]='A'; syslog(LOG_ERR, buffer); } Now here's the problem: When compiling with "gcc file.c", the program segfaults. Whe