Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: brobecker@adacore.com, gdb@sourceware.org, siddhesh@redhat.com
Subject: Re: Old OSes compatibility  [Re: 64-bit (>4GB) inferior data types rules; TYPE_LENGTH: unsigned -> ULONGEST]
Date: Mon, 01 Oct 2012 17:32:00 -0000	[thread overview]
Message-ID: <83d312ayjy.fsf@gnu.org> (raw)
In-Reply-To: <20121001164833.GA20592@host2.jankratochvil.net>

> Date: Mon, 1 Oct 2012 18:48:33 +0200
> From: Jan Kratochvil <jan.kratochvil@redhat.com>
> Cc: gdb@sourceware.org, Siddhesh Poyarekar <siddhesh@redhat.com>
> 
> 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

It is not a good idea to judge about overall C99 acceptance by looking
at its select features.  Some features are very widespread, others
much less.

Therefore, the fact that MSVC supports anonymous unions says nothing
about its support of %z.

Moreover, at least regarding the MS platforms and MinGW (not MSVC),
there are 2 separate components involved.  One is GCC, which could be
very modern and know about C99 and %z, the other is the runtime
library, which is not redistributable, and therefore one uses whatever
came with the OS out of the box.  For example, a Windows XP system
will generally have runtime that goes back to Studio 2003 (VC version
7.1), and Windows 7 will use VC v9.0, I think, from Studio 2008.
These are quite old.  And support for %z comes from the library, of
course.

> 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.

FWIW, even the latest Studio 2012 doesn't yet support %z, according to
this:

  http://msdn.microsoft.com/en-us/library/hf4y5e3w%28v=vs.110%29.aspx


  parent reply	other threads:[~2012-10-01 17:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-28 17:32 64-bit (>4GB) inferior data types rules; TYPE_LENGTH: unsigned -> ULONGEST Jan Kratochvil
2012-09-28 20:23 ` Sergio Durigan Junior
2012-09-29  6:08   ` Jan Kratochvil
2012-09-29 16:58 ` Jan Kratochvil
2012-09-30 16:56 ` Joel Brobecker
2012-10-01 16:48   ` Old OSes compatibility [Re: 64-bit (>4GB) inferior data types rules; TYPE_LENGTH: unsigned -> ULONGEST] Jan Kratochvil
2012-10-01 17:18     ` Pedro Alves
2012-10-01 17:38       ` Eli Zaretskii
2012-10-01 18:01         ` Pedro Alves
2012-10-01 19:14           ` Eli Zaretskii
2012-10-01 17:32     ` Eli Zaretskii [this message]
2012-10-01 17:55       ` Jan Kratochvil
2012-10-01 17:57         ` Joel Brobecker
2012-10-01 18:08           ` Jan Kratochvil
2012-10-01 18:13             ` Joel Brobecker
2012-10-01 18:29               ` Jan Kratochvil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83d312ayjy.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=brobecker@adacore.com \
    --cc=gdb@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=siddhesh@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox