[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: libc6: errno problem



On Jul 19, Christian Schwarz <schwarz@monet.m.isar.de> wrote:
> I tried to recompile my "cdrecord" package with the new libc6 and ran into
> the following problem. Please consider this example:
> 
> 	#include <errno.h>
> 
> 	struct x {
> 	  int errno;
> 	}
> 
> 	main() { }
> 
> When I compile this little program with libc6, I get:
> 
> 	$ make errno_test   
> 	cc     errno_test.c   -o errno_test
> 	errno_test.c:4: field `__errno_location' declared as a function
> 	make: *** [errno_test] Error 1
> 	$
> 
> In errnos.h, there is a define for "errno" which causes this problem. What
> can I do to prevent this? (Other than, "#undef errno", since I want to
> access the variable "errno" too.)

You have to rename your structure variable. Once you've included
errno.h, the identifier "errno" is reserved for any use (ISO C standard,
sections 7.1.3 and 7.1.4).

SteveG

-- 
The Mole - I think, therefore I scream 

			"The value of marriage is not that adults produce
			 children, but that children produce adults."
[Peter De Vries]


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: