Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Jan 2009 12:39:28 +0100
From:      Stefan Farfeleder <stefan@fafoe.narf.at>
To:        Danny Braniss <danny@cs.huji.ac.il>
Cc:        Christian Kandeler <christian.kandeler@hob.de>, Garrett Cooper <yanefbsd@gmail.com>, Christoph Mallon <christoph.mallon@gmx.de>, freebsd-hackers@freebsd.org
Subject:   Re: Confused by segfault with legitimate call to strerror(3) on amd64 / sysctl (3) setting `odd' errno's
Message-ID:  <20090116113928.GA1361@lizard.fafoe.narf.at>
In-Reply-To: <E1LNmxG-000PSq-DI@kabab.cs.huji.ac.il>
References:  <7d6fde3d0901160041n55466290l55f737d274a40895@mail.gmail.com> <49704AEC.3080709@gmx.de> <200901161039.00232.christian.kandeler@hob.de> <49705FA2.2020605@gmx.de> <7d6fde3d0901160235o6aa1f096q11c5096b70f3577@mail.gmail.com> <497065ED.7050705@gmx.de> <E1LNmxG-000PSq-DI@kabab.cs.huji.ac.il>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jan 16, 2009 at 01:33:38PM +0200, Danny Braniss wrote:
> some facts:
> #include <stdio.h>
> int
> main()
> {
>      printf("%s\n", strerror(2));
>      return 0;
> }
> 
> 	1- it works fine on i386
> 	2- it bombs on amd64
> 	3- with a local strerror.c (instead of the one in libc)
> 	   works fine
> so, there is something realy wrong going on here!
> (and it gows back to at least 7.0-stable)

The compiler thinks strerror returns an int.  Include <string.h>.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090116113928.GA1361>