From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9822 invoked by alias); 1 Oct 2012 16:48:47 -0000 Received: (qmail 9735 invoked by uid 22791); 1 Oct 2012 16:48:45 -0000 X-SWARE-Spam-Status: No, hits=-7.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 01 Oct 2012 16:48:40 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q91GmbU5010531 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 1 Oct 2012 12:48:37 -0400 Received: from host2.jankratochvil.net (ovpn-116-34.ams2.redhat.com [10.36.116.34]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q91GmXxh009147 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 1 Oct 2012 12:48:36 -0400 Date: Mon, 01 Oct 2012 16:48:00 -0000 From: Jan Kratochvil To: Joel Brobecker Cc: gdb@sourceware.org, Siddhesh Poyarekar Subject: Old OSes compatibility [Re: 64-bit (>4GB) inferior data types rules; TYPE_LENGTH: unsigned -> ULONGEST] Message-ID: <20121001164833.GA20592@host2.jankratochvil.net> References: <20120928173229.GA10406@host2.jankratochvil.net> <20120930165630.GA30746@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120930165630.GA30746@adacore.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2012-10/txt/msg00000.txt.bz2 On Sun, 30 Sep 2012 18:56:30 +0200, Joel Brobecker wrote: > > BTW for size_t/ssize_t format string is "%z". > > Unfortunately, that's C99... Not sure what the best approach would > be - I think people typically cast to long or unsigned long and > then use the us %l or %ul. this is repeating issue, GDB is not C90 compatible despite being claimed so: Re: [no-commit-intention] Naive unnamed fields for main_type [...] http://sourceware.org/ml/gdb-patches/2012-02/msg00146.html GDB has not been kept compatible even with Solaris which is a very live OS: Various build-related fixes for solaris http://sourceware.org/ml/gdb-patches/2012-09/msg00404.html Summary of the first thread (authorship of the statements is in mails above): Even GCC does not fully support C99 ( http://gcc.gnu.org/c99status.html ) but all compilers in use support the important parts of C99, incl. gcc-2.9x. As an example anonymous unions are supported by MS Visual Studio 6.0 (1998), http://msdn.microsoft.com/en-us/library/aa270923%28v=vs.60%29.aspx 'long long' is supported at least by MS Visual Studio 2005: http://msdn.microsoft.com/en-us/library/s3f49ktz%28v=vs.80%29.aspx I have no idea about HP cc etc. but I believe those in use also support it. Moreover GNU policy is OK with even C99 (probably its GCC subset). And issues like insufficient system vasprintf can be easily fixed by adding vasprintf from gnulib. If there pops up some incompatibility it can be easily fixed / reverted. Keeping compatibility with ghost systems nobody knows whether they still exist I do not find useful. Various fixed incl. 'Various build-related fixes for solaris' prove the compatibility with OSes not in use is not out of the box. Just there should be kept some viable way how to fix it up when such compatibility issue pops up. Therefore I believe "%z" is OK, it would be nice to check it with several major non-GNU systems whether gnulib vasprintf should be already included. Thanks, Jan