From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bruno Haible Newsgroups: gmane.emacs.bugs Subject: bug#9025: 24.0.50; gnulib defines intmax_t to int64_t on OSX, causes warnings and confusion. Date: Sat, 9 Jul 2011 12:27:01 +0200 Message-ID: <201107091227.03099.bruno__13448.363755788$1310207308$gmane$org@clisp.org> References: <4E1826ED.9020602@cs.ucla.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1310207308 28697 80.91.229.12 (9 Jul 2011 10:28:28 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 9 Jul 2011 10:28:28 +0000 (UTC) Cc: 9025@debbugs.gnu.org, Paul Eggert To: bug-gnulib@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 09 12:28:21 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QfUlo-0007g4-8D for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Jul 2011 12:28:20 +0200 Original-Received: from localhost ([::1]:54742 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QfUln-0004tX-7q for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Jul 2011 06:28:19 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:50784) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QfUlY-0004tO-1w for bug-gnu-emacs@gnu.org; Sat, 09 Jul 2011 06:28:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QfUlW-0007tl-W8 for bug-gnu-emacs@gnu.org; Sat, 09 Jul 2011 06:28:04 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51757) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QfUlW-0007th-Ua for bug-gnu-emacs@gnu.org; Sat, 09 Jul 2011 06:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QfUlW-0002dU-9n; Sat, 09 Jul 2011 06:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Bruno Haible Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Jul 2011 10:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9025 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9025-submit@debbugs.gnu.org id=B9025.131020723310079 (code B ref 9025); Sat, 09 Jul 2011 10:28:02 +0000 Original-Received: (at 9025) by debbugs.gnu.org; 9 Jul 2011 10:27:13 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QfUkj-0002cW-7j for submit@debbugs.gnu.org; Sat, 09 Jul 2011 06:27:13 -0400 Original-Received: from mo-p00-ob.rzone.de ([81.169.146.160]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QfUkf-0002cI-Vr for 9025@debbugs.gnu.org; Sat, 09 Jul 2011 06:27:11 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1310207224; l=1896; s=domk; d=haible.de; h=Content-Transfer-Encoding:Content-Type:MIME-Version:In-Reply-To: References:Cc:Date:Subject:To:From:X-RZG-CLASS-ID:X-RZG-AUTH; bh=c8nRmvyeBloNvGd/IIhOTazSu6k=; b=aAWWKkZ0sowzOTUk4JfFvNKxEHGZbmo4hmReZzOH1lGIblohj7rUae4Ipp+0kADG3SD vsGH4GAqZOorz+H4fe04LMqev+CQBk6s9YyY469Gv8L7FqYPClNdzKpBaxKq2FrgXKV+W 61XGZZHJBuZDs4uNkkxAqFTDw2yLw4XNPcw= X-RZG-AUTH: :Ln4Re0+Ic/6oZXR1YgKryK8brksyK8dozXDwHXjf9hj/zDNRbfQ44IxORg== X-RZG-CLASS-ID: mo00 Original-Received: from linuix.haible.de (dslb-088-068-042-252.pools.arcor-ip.net [88.68.42.252]) by smtp.strato.de (cohen mo45) (RZmta 26.0) with ESMTPA id 600a7dn697PiGa ; Sat, 9 Jul 2011 12:27:03 +0200 (MEST) User-Agent: KMail/1.9.9 In-Reply-To: <4E1826ED.9020602@cs.ucla.edu> Content-Disposition: inline X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 09 Jul 2011 06:28:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:48321 Archived-At: Jan Dj=C3=A4rv writes: > > Somewhere in gnulib, intmax_t gets defined to int64_t thus causing > > compiler warnings and general confusion (the code says intmax_t but is > > really int64_t). AFAIK, all versions of OSX have intmax_t. Please provide a reproducible test case, preferrably outside Emacs. Also, I don't understand what's the problem: intmax_t must be 64-bit on MacOS X. No compiler supports 128-bit integers, AFAIK. Can you explain? Paul Eggert wrote: > Which compiler and OS version are you using? >=20 > Does the following (untested) patch to lib/stdint.in.h fix your problem? >=20 > diff --git a/lib/stdint.in.h b/lib/stdint.in.h > index c44401f..0dd60b9 100644 > --- a/lib/stdint.in.h > +++ b/lib/stdint.in.h > @@ -270,6 +270,11 @@ typedef unsigned long int gl_uintptr_t; > /* Note: These types are compiler dependent. It may be unwise to use the= m in > public header files. */ > =20 > +/* If the system defines INTMAX_MAX, assume that intmax_t works, and > + similarly for UINTMAX_MAX and uintmax_t. This avoids problems with > + assuming one type where another is used by the system. */ > + > +#ifndef INTMAX_MAX > #undef intmax_t > #if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 =3D=3D 1 > typedef long long int gl_intmax_t; > @@ -280,7 +285,9 @@ typedef long long int gl_intmax_t; > typedef long int gl_intmax_t; > # define intmax_t gl_intmax_t > #endif > +#endif Untested patches are OK in simple areas. But in complex areas like stdint.i= n.h I would really like to understand the problem before applying any patch. Th= at means, provide a reproducible sample (including all details about OS, compi= ler, compiler options), and show the preprocessing result (output of "$CC -E" or =2D even better - "$CC -E -dD") of the code that gives warnings. Bruno =2D-=20 In memoriam B=C3=A1b