Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Jun 1999 15:13:07 -0400 (EDT)
From:      Marc Tardif <intmktg@CAM.ORG>
To:        freebsd-hackers@freebsd.org
Subject:   a.out behavior
Message-ID:  <Pine.SOL.4.10.9906061507390.21415-100000@Ocean.CAM.ORG>

next in thread | raw e-mail | index | archive | help
The following code should obviously segfault:
#include <stdio.h>
#include <syslog.h>

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.
When compiling with "gcc -o file file.c", the program doesn't segfault.
Both files are nevertheless identical, apart from the name of the
temporary object file name which could be made the same (search for cc00,
perhaps).

I'm using freebsd 2.2.5, gcc 2.7.2.1. Someone please let me know what's so
special about a.out.

Thanks in advance,
Marc



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SOL.4.10.9906061507390.21415-100000>