Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: brobecker@adacore.com
Cc: tromey@redhat.com, mark.kettenis@xs4all.nl, dje@google.com,
	       pierre.muller@ics-cnrs.unistra.fr,
	gdb-patches@sourceware.org
Subject: Re: New ARI warning Wed May 23 01:55:03 UTC 2012
Date: Tue, 26 Jun 2012 13:31:00 -0000	[thread overview]
Message-ID: <201206261330.q5QDU9hC017485@glazunov.sibelius.xs4all.nl> (raw)
In-Reply-To: <20120622190228.GM2799@adacore.com> (message from Joel Brobecker	on Fri, 22 Jun 2012 12:02:28 -0700)

> Date: Fri, 22 Jun 2012 12:02:28 -0700
> From: Joel Brobecker <brobecker@adacore.com>
> 
> > >> * configure.ac (build_warnings): Add -Wdeclaration-after-statement.
> > >> * configure: Regenerate.
> > 
> > Yes, ok.  Thanks; I hadn't realized there was a flag for this already :)
> 
> Thanks, checked in.
> 
> > Discussion on irc pointed out that this is still allowed:
> > 
> >     for (int i = 0; ...)
> > 
> > I think this doesn't suffer from the readability problems that
> > declarations in the code generally do; and in fact usually makes the
> > code cleaner, by restricting the scope of the loop variable.
> 
> Agreed.
> 
> Note that this is only going to be accepted if we compile in
> C99 mode, I think.  Otherwise, you'll get a warning which is
> unrelated declarations being used after statements.
> 
>     error: 'for' loop initial declarations are only allowed in C99 mode
> 
> > How about we flip the switch to C99 for 7.6?
> 
> Sounds good to me. Do we want to be exclusive, rather than inclusive?
> In other words, say: The following C99 constructs are allowed, and
> maintain that list, rather that allow all of C99, and then list
> the features not allowed. I understand that some features are still
> not implemented (or portable?).

I'm not aware of any C99 language features that aren't widely
implemented by the halfway modern compilers.  But there might be some
obscure corners of the standard that I'm not familiar with.  I think
only the approach of listing features that we don't allow makes sense.
That list should be very short.

C99 library functions and header files are a different matter though.
Those may not be available on older systems.  We can only use those if
we provide proper replacement functions (e.g. gnulib).


  parent reply	other threads:[~2012-06-26 13:31 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-23  1:55 GDB Administrator
2012-05-23  4:18 ` Sergio Durigan Junior
2012-05-23  7:10   ` Doug Evans
2012-05-23  7:27     ` Doug Evans
2012-05-23  8:19       ` Pierre Muller
2012-05-23 14:45       ` Sergio Durigan Junior
     [not found]       ` <4fbc9d77.0853b40a.641e.ffff90dbSMTPIN_ADDED@mx.google.com>
2012-05-23 14:46         ` Doug Evans
2012-05-23 15:01           ` Doug Evans
2012-05-23 15:27             ` Pedro Alves
2012-05-24 18:55           ` Tom Tromey
2012-05-28 20:44             ` Mark Kettenis
2012-05-28 21:59               ` Joel Brobecker
2012-05-29 13:29               ` Maciej W. Rozycki
2012-06-22 16:05               ` Tom Tromey
2012-06-22 17:19                 ` Joel Brobecker
2012-06-22 17:31                   ` Joel Brobecker
2012-06-22 17:41                     ` Tom Tromey
2012-06-22 19:02                       ` Joel Brobecker
2012-06-25 19:59                         ` Doug Evans
2012-06-26 13:31                         ` Mark Kettenis [this message]
2012-06-26 13:15                   ` Mark Kettenis
2012-06-26 11:51                 ` Mark Kettenis
2012-05-23  7:10   ` Andreas Schwab

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=201206261330.q5QDU9hC017485@glazunov.sibelius.xs4all.nl \
    --to=mark.kettenis@xs4all.nl \
    --cc=brobecker@adacore.com \
    --cc=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pierre.muller@ics-cnrs.unistra.fr \
    --cc=tromey@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