This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Old OSes compatibility [Re: 64-bit (>4GB) inferior data types rules; TYPE_LENGTH: unsigned -> ULONGEST]


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]