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

Bug#174933: marked as done (libc header defines LITTLE_ENDIAN and polluts user name space)



Your message dated Wed, 1 Jan 2003 15:16:29 -0500
with message-id <20030101201629.GA18266@nevyn.them.org>
and subject line Bug#174933: libc header defines LITTLE_ENDIAN and polluts user name space
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 1 Jan 2003 18:46:16 +0000
>From ishikawa@yk.rim.or.jp Wed Jan 01 12:46:15 2003
Return-path: <ishikawa@yk.rim.or.jp>
Received: from pl2000.nas911.n-yokohama.nttpc.ne.jp (standard.erephon) [210.139.52.208] 
	by master.debian.org with esmtp (Exim 3.12 1 (Debian))
	id 18Tnsc-0002CQ-00; Wed, 01 Jan 2003 12:46:15 -0600
Received: by yk.rim.or.jp
	via sendmail from stdin
	id <[🔎] m18Tnsa-000GwvC@standard.erephon> (Debian Smail3.2.0.114)
	for submit@bugs.debian.org; Thu, 2 Jan 2003 03:46:12 +0900 (JST) 
Message-Id: <[🔎] m18Tnsa-000GwvC@standard.erephon>
Date: Thu, 2 Jan 2003 03:46:12 +0900 (JST)
To: submit@bugs.debian.org
From: ishikawa@yk.rim.or.jp
Reply-to: ishikawa@yk.rim.or.jp
Subject: libc header defines LITTLE_ENDIAN and polluts user name space
Delivered-To: submit@bugs.debian.org
X-Spam-Status: No, hits=-1.9 required=5.0
	tests=NO_REAL_NAME,SPAM_PHRASE_00_01,SUPERLONG_LINE
	version=2.41
X-Spam-Level: 

Package: libc6-dev
Version: 2.2.5-14.3

Severity: normal

Problem description.

libc header somehow pollutes the
user name space by defining a macro, LITTLE_ENDIAN.
This doesn't happen, say, on RedHat linux and
so presumably a problem of configuring glibc under
Debian.

REPEAT-BY:

Please note the following little program that
includes "<stdlib.h>".
I take that stdlib.h is part of ISO C99 standard (draft?)
from the comment near the top
 Quote :
/*
 *	ISO C99 Standard: 7.20 General utilities	<stdlib.h>
 */
 Unquote


If I compile this program by defining LITTLE_ENDIAN with
-DLITTLE_ENDIAN=1 on the command line, I get warning
from GCC. This doesn't happen on other UNIX-like systems, say,
RedHat and Solaris.

ishikawa@duron$ cat little.c
#include <stdlib.h>
#include <string.h>

int
test(int i)
{
	return i + 10;
}

ishikawa@duron$ gcc -v -DLITTLE_ENDIAN=1 -c little.c
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.4/specs
gcc version 2.95.4 20011002 (Debian prerelease)
 /usr/lib/gcc-lib/i386-linux/2.95.4/cpp0 -lang-c -v -D__GNUC__=2 -D__GNUC_MINOR__=95 -D__ELF__ -Dunix -D__i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix -D__linux -Asystem(posix) -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -DLITTLE_ENDIAN=1 little.c /tmp/ccpuhTGN.i
GNU CPP version 2.95.4 20011002 (Debian prerelease) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/lib/gcc-lib/i386-linux/2.95.4/include
 /usr/include
End of search list.
The following default directories have been omitted from the search path:
 /usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3
 /usr/lib/gcc-lib/i386-linux/2.95.4/../../../../i386-linux/include
End of omitted list.
In file included from /usr/include/sys/types.h:212,
                 from /usr/include/stdlib.h:390,
                 from little.c:1:
/usr/include/endian.h:46: warning: `LITTLE_ENDIAN' redefined
*Initialization*:1: warning: this is the location of the previous definition
 /usr/lib/gcc-lib/i386-linux/2.95.4/cc1 /tmp/ccpuhTGN.i -quiet -dumpbase little.c -version -o /tmp/cckeNbGt.s
GNU C version 2.95.4 20011002 (Debian prerelease) (i386-linux) compiled by GNU C version 2.95.4 20011002 (Debian prerelease).
 as -V -Qy -o little.o /tmp/cckeNbGt.s
GNU assembler version 2.13.90.0.10 (i386-linux) using BFD version 2.13.90.0.10 20021010 Debian GNU/Linux
ishikawa@duron$ 


ishikawa@duron$ grep LITTLE_ENDIAN /usr/include/endian.h
#define	__LITTLE_ENDIAN	1234
# define LITTLE_ENDIAN	__LITTLE_ENDIAN
#if __BYTE_ORDER == __LITTLE_ENDIAN
ishikawa@duron$ 




Package Status

ishikawa@duron$ dpkg --status libc6-dev
Package: libc6-dev
Status: install ok installed
Priority: standard
Section: devel
Installed-Size: 11620
Maintainer: GNU Libc Maintainers <debian-glibc@lists.debian.org>
Source: glibc
Version: 2.2.5-14.3
Replaces: man-db (<= 2.3.10-41), gettext (<= 0.10.26-1), ppp (<= 2.2.0f-24), libgdbmg1-dev (<= 1.7.3-24), ldso (<= 1.9.11-9), netkit-rpc, netbase (<< 4.0)
Provides: libc-dev
Depends: libc6 (= 2.2.5-14.3)
Recommends: c-compiler
Suggests: glibc-doc
Conflicts: libstdc++2.10-dev (<< 1:2.95.2-15), gcc-2.95 (<< 1:2.95.3-9), libpthread0-dev, libdl1-dev, libdb1-dev, libgdbm1-dev, libc6-dev (<< 2.0.110-1), locales (<< 2.1.3-5), libstdc++2.9-dev, netkit-rpc, libc-dev
Description: GNU C Library: Development Libraries and Header Files.
 Contains the symlinks, headers, and object files needed to compile
 and link programs which use the standard C library.


---------------------------------------
Received: (at 174933-done) by bugs.debian.org; 1 Jan 2003 20:16:40 +0000
>From drow@false.org Wed Jan 01 14:16:40 2003
Return-path: <drow@false.org>
Received: from crack.them.org [65.125.64.184] (mail)
	by master.debian.org with esmtp (Exim 3.12 1 (Debian))
	id 18TpI8-0006GT-00; Wed, 01 Jan 2003 14:16:40 -0600
Received: from nevyn.them.org ([66.93.61.169] ident=mail)
	by crack.them.org with asmtp (Exim 3.12 #1 (Debian))
	id 18TrAZ-00079c-00; Wed, 01 Jan 2003 16:16:59 -0600
Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian))
	id 18TpHx-0004oe-00; Wed, 01 Jan 2003 15:16:29 -0500
Date: Wed, 1 Jan 2003 15:16:29 -0500
From: Daniel Jacobowitz <dan@debian.org>
To: ishikawa@yk.rim.or.jp, 174933-done@bugs.debian.org
Subject: Re: Bug#174933: libc header defines LITTLE_ENDIAN and polluts user name space
Message-ID: <20030101201629.GA18266@nevyn.them.org>
References: <[🔎] m18Tnsa-000GwvC@standard.erephon>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <[🔎] m18Tnsa-000GwvC@standard.erephon>
User-Agent: Mutt/1.5.1i
Delivered-To: 174933-done@bugs.debian.org
X-Spam-Status: No, hits=-16.5 required=5.0
	tests=IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES,
	      SIGNATURE_SHORT_DENSE,SPAM_PHRASE_03_05,USER_AGENT,
	      USER_AGENT_MUTT
	version=2.41
X-Spam-Level: 

On Thu, Jan 02, 2003 at 03:46:12AM +0900, ishikawa@yk.rim.or.jp wrote:
> Package: libc6-dev
> Version: 2.2.5-14.3
> 
> Severity: normal
> 
> Problem description.
> 
> libc header somehow pollutes the
> user name space by defining a macro, LITTLE_ENDIAN.
> This doesn't happen, say, on RedHat linux and
> so presumably a problem of configuring glibc under
> Debian.
> 
> REPEAT-BY:
> 
> Please note the following little program that
> includes "<stdlib.h>".
> I take that stdlib.h is part of ISO C99 standard (draft?)
> from the comment near the top
>  Quote :
> /*
>  *	ISO C99 Standard: 7.20 General utilities	<stdlib.h>
>  */
>  Unquote

No; that's the section describing stdlib.h, but that version of the
file supports multiple C standards.

> If I compile this program by defining LITTLE_ENDIAN with
> -DLITTLE_ENDIAN=1 on the command line, I get warning
> from GCC. This doesn't happen on other UNIX-like systems, say,
> RedHat and Solaris.

This is a standard behavior for glibc, in all recent versions.  It
hasn't changed in a long time.  If you do not specify a default, then
glibc includes certain BSD extensions; this is one of them.  If you
want the namespace rules to be strictly obeyed, use the relevant
preprocessor directive.  See <features.h> or the manual for a list of
them.

I don't know why you don't see it under Red Hat; I do, on the only RH
install I have here.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer



Reply to: