From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.comp.lib.gnulib.bugs,gmane.emacs.devel Subject: Re: [Jim Meyering] Re: strftime merge from Emacs Date: 11 Jun 2003 10:29:34 -0700 Sender: bug-gnulib-bounces+gnu-bug-gnulib=m.gmane.org@gnu.org Message-ID: <878ys8setd.fsf@penguin.cs.ucla.edu> References: <200306111214.56921.bruno@clisp.org> <3EE7047D.8060706@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1055352689 10982 80.91.224.249 (11 Jun 2003 17:31:29 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 11 Jun 2003 17:31:29 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: bug-gnulib-bounces+gnu-bug-gnulib=m.gmane.org@gnu.org Wed Jun 11 19:31:26 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19Q9RW-0002qr-00 for ; Wed, 11 Jun 2003 19:31:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19Q9Tu-0007FC-IP for gnu-bug-gnulib@m.gmane.org; Wed, 11 Jun 2003 13:33:54 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19Q9Tl-0006yL-Ig for bug-gnulib@gnu.org; Wed, 11 Jun 2003 13:33:45 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19Q9Te-0006tF-Md for bug-gnulib@gnu.org; Wed, 11 Jun 2003 13:33:39 -0400 Original-Received: from gnuftp.gnu.org ([199.232.41.6]) by monty-python.gnu.org with esmtp (Exim 4.20) id 19Q9TU-0006Nq-Jz; Wed, 11 Jun 2003 13:33:28 -0400 Original-Received: from panther.cs.ucla.edu ([131.179.128.25]) by gnuftp.gnu.org with esmtp (Exim 4.20) id 19Q9Pp-00045l-Hx; Wed, 11 Jun 2003 13:29:41 -0400 Original-Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) h5BHTYu26495; Wed, 11 Jun 2003 10:29:34 -0700 (PDT) Original-Received: from eggert by penguin.cs.ucla.edu with local (Exim 3.35 #1 (Debian)) id 19Q9Pi-0000FT-00; Wed, 11 Jun 2003 10:29:34 -0700 Original-To: Jason Rumney In-Reply-To: <3EE7047D.8060706@gnu.org> Original-Lines: 29 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 Original-cc: bug-gnulib@gnu.org X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: The GNUlib portability library bug discussion list List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: bug-gnulib-bounces+gnu-bug-gnulib=m.gmane.org@gnu.org Xref: main.gmane.org gmane.comp.lib.gnulib.bugs:530 gmane.emacs.devel:15046 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:15046 Jason Rumney writes: > I wonder why you need to redeclare tzname[] there, do header files not > already declare it on platforms where HAVE_TZNAME is defined? Yes, depending on compilation options. For example, I get the following symptomps on both Debian GNU/Linux 3.0r1 and on Solaris 8: $ cat t.c #include int main (void) { return !tzname; } $ gcc -c t.c $ gcc -c -ansi t.c t.c: In function `main': t.c:2: `tzname' undeclared (first use in this function) t.c:2: (Each undeclared identifier is reported only once t.c:2: for each function it appears in.) This is because the C standard does not allow to declare tzname; a strictly conforming C program can declare its own variable called 'tzname' with entirely different semantics. Perhaps AC_STRUCT_TIMEZONE should also check whether tzname is declared, and if so, define HAVE_DECL_TZNAME. Then we could adjust the code as follows: #if HAVE_TZNAME && !HAVE_DECL_TZNAME && !defined tzname extern char *tzname[]; #endif