Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <macro@codesourcery.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [PATCH] microMIPS support
Date: Thu, 26 Apr 2012 21:59:00 -0000	[thread overview]
Message-ID: <alpine.DEB.1.10.1204262219170.19835@tp.orcam.me.uk> (raw)
In-Reply-To: <20120426192611.GA24056@host2.jankratochvil.net>

On Thu, 26 Apr 2012, Jan Kratochvil wrote:

> > > static const char *const mips_compression_strings[] = {
> > 
> >  Hmm, no objection to your suggestion per se, but is it allowed by C89?
> 
> It is already used in GDB since:
> 	http://sourceware.org/ml/gdb-patches/2012-01/msg00973.html
> 	[obv] Code cleanup: add_setshow_enum_cmd: Make 1440 bytes of data segment read-only

 But it's your own change and there wasn't any discussion about it there, 
so I can't take it as an argument, sorry.

> I am not aware of any compatibility issue of it.

 But are you absolutely sure that it was a supported construct with C89 or 
are you only assuming having no counter-evidence?  Do you have a copy of 
the standard?  Unfortunately I don't or otherwise I would have checked 
myself and C99 doesn't note it in the list of major changes from the 
previous version of the standard (but then I wouldn't classify it as a 
major change).

 At the time I learnt C (some 18 years ago) that certainly wasn't a 
construct I had seen in any language reference I had available or was made 
aware of in any other way and I am fairly sure it's quite a recent 
addition.  I first heard of it in the 2000s only (and then well into).  
An equivalent construct that I am sure to be portable is:

typedef const char *ccharp;
const ccharp foo;

but I'm not sure that's maintainable -- too obfuscated in my view.

 AFAIK we still require our code to conform to C89 (fortunately not K&R 
anymore) or we could use lots of good stuff, starting from the long long 
type (so much needed for MIPS opcode tables in opcodes/ among others; we 
had a discussion in the context of MIPS segments not so long ago here as 
well, ending with a piece of convoluted code to avoid both the long long 
type and compiler warnings, depending on the configuration chosen), 
through designated initialisers (suddenly you stop losing track of your 
NULLs through your 50-member struct), etc.

 Any comments, anyone?

  Maciej


  reply	other threads:[~2012-04-26 21:52 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-24 21:18 Maciej W. Rozycki
2012-04-25  6:20 ` Eli Zaretskii
2012-04-26 13:54   ` Maciej W. Rozycki
2012-04-26 14:14     ` Eli Zaretskii
2012-04-26 18:03       ` Maciej W. Rozycki
2012-04-26 20:39         ` Eli Zaretskii
2012-04-27 18:16           ` Maciej W. Rozycki
2012-04-27 18:24             ` Eli Zaretskii
     [not found]               ` <alpine.DEB.1.10.1204302334520.19835@tp.orcam.me.uk>
2012-05-02 16:39                 ` Eli Zaretskii
2012-05-17 15:07                   ` Maciej W. Rozycki
2012-05-17 16:10                     ` Eli Zaretskii
2012-05-18 23:13                       ` Maciej W. Rozycki
2012-05-19  8:20                         ` Eli Zaretskii
2012-04-25 13:13 ` Yao Qi
2012-04-25 15:57   ` Maciej W. Rozycki
2012-04-25 15:54 ` Joel Brobecker
2012-04-25 17:18   ` Maciej W. Rozycki
2012-04-25 18:12     ` Joel Brobecker
2012-04-25 18:27       ` Maciej W. Rozycki
2012-04-26 18:38 ` Jan Kratochvil
2012-04-26 19:04   ` Maciej W. Rozycki
2012-04-26 19:29     ` Jan Kratochvil
2012-04-26 21:59       ` Maciej W. Rozycki [this message]
2012-04-27  7:11         ` Jan Kratochvil
2012-04-27 15:14           ` Maciej W. Rozycki
2012-04-27 15:29             ` Pedro Alves
2012-04-27 15:46               ` Maciej W. Rozycki
2012-04-27 15:54             ` Tom Tromey
2012-05-18 23:53     ` Maciej W. Rozycki
2012-05-18 21:32 ` [PATCH] microMIPS support (Linux signal trampolines) Maciej W. Rozycki
2012-05-18 22:25   ` Mark Kettenis
2012-05-21 14:33     ` Maciej W. Rozycki
2012-06-11 10:32       ` [PING][PATCH] " Maciej W. Rozycki
2014-09-28 11:12       ` [PATCH] " Maciej W. Rozycki
2014-10-06  0:46         ` [PING][PATCH] " Maciej W. Rozycki
2014-10-13 12:24           ` [PING^2][PATCH] " Maciej W. Rozycki
2014-10-20 17:01             ` [PING^3][PATCH] " Maciej W. Rozycki
2014-11-03 16:04               ` [PING^4][PATCH] " Maciej W. Rozycki
2014-11-16  8:58         ` [PATCH] " Joel Brobecker
2014-12-03 21:00           ` Maciej W. Rozycki
2012-05-18 23:47 ` [PATCH] microMIPS support Maciej W. Rozycki
2012-05-19  8:52   ` Eli Zaretskii
2012-05-22  0:07     ` Maciej W. Rozycki

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=alpine.DEB.1.10.1204262219170.19835@tp.orcam.me.uk \
    --to=macro@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@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