public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb@sourceware.org, Siddhesh Poyarekar <siddhesh@redhat.com>
Subject: Old OSes compatibility  [Re: 64-bit (>4GB) inferior data types rules; TYPE_LENGTH: unsigned -> ULONGEST]
Date: Mon, 01 Oct 2012 16:48:00 -0000	[thread overview]
Message-ID: <20121001164833.GA20592@host2.jankratochvil.net> (raw)
In-Reply-To: <20120930165630.GA30746@adacore.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
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

  reply	other threads:[~2012-10-01 16:48 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   ` Jan Kratochvil [this message]
2012-10-01 17:18     ` Old OSes compatibility [Re: 64-bit (>4GB) inferior data types rules; TYPE_LENGTH: unsigned -> ULONGEST] 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
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=20121001164833.GA20592@host2.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=brobecker@adacore.com \
    --cc=gdb@sourceware.org \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).