public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [fixme] another case statement without a break -- intentional?
@ 2011-02-26 20:50 Michael Snyder
  2011-02-28  4:23 ` Joel Brobecker
  2011-02-28  4:47 ` [commit] add FALLTHROUGH comment in ada-exp.y:write_object_renaming Joel Brobecker
  0 siblings, 2 replies; 4+ messages in thread
From: Michael Snyder @ 2011-02-26 20:50 UTC (permalink / raw)
  To: gdb-patches, Joel Brobecker

[-- Attachment #1: Type: text/plain, Size: 51 bytes --]

Joel, can I ask you for a judgement call?
Michael


[-- Attachment #2: fallthru2.txt --]
[-- Type: text/plain, Size: 499 bytes --]

Index: ada-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/ada-exp.y,v
retrieving revision 1.41
diff -u -p -u -p -r1.41 ada-exp.y
--- ada-exp.y	1 Jan 2011 15:32:55 -0000	1.41
+++ ada-exp.y	26 Feb 2011 20:42:51 -0000
@@ -920,6 +920,7 @@ write_object_renaming (struct block *ori
         break;
       case 'L':
 	slice_state = LOWER_BOUND;
+	/* FIXME --- fall through????  */
       case 'S':
 	renaming_expr += 1;
 	if (isdigit (*renaming_expr))

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [fixme] another case statement without a break -- intentional?
  2011-02-26 20:50 [fixme] another case statement without a break -- intentional? Michael Snyder
@ 2011-02-28  4:23 ` Joel Brobecker
  2011-02-28 18:00   ` Michael Snyder
  2011-02-28  4:47 ` [commit] add FALLTHROUGH comment in ada-exp.y:write_object_renaming Joel Brobecker
  1 sibling, 1 reply; 4+ messages in thread
From: Joel Brobecker @ 2011-02-28  4:23 UTC (permalink / raw)
  To: Michael Snyder; +Cc: gdb-patches

> Joel, can I ask you for a judgement call?
> Michael

Yes, the fallthrough seems to be by-design, but I will ask Paul,
who wrote that code.

Thanks,
-- 
Joel

> Index: ada-exp.y
> ===================================================================
> RCS file: /cvs/src/src/gdb/ada-exp.y,v
> retrieving revision 1.41
> diff -u -p -u -p -r1.41 ada-exp.y
> --- ada-exp.y	1 Jan 2011 15:32:55 -0000	1.41
> +++ ada-exp.y	26 Feb 2011 20:42:51 -0000
> @@ -920,6 +920,7 @@ write_object_renaming (struct block *ori
>          break;
>        case 'L':
>  	slice_state = LOWER_BOUND;
> +	/* FIXME --- fall through????  */
>        case 'S':
>  	renaming_expr += 1;
>  	if (isdigit (*renaming_expr))


-- 
Joel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [commit] add FALLTHROUGH comment in ada-exp.y:write_object_renaming
  2011-02-26 20:50 [fixme] another case statement without a break -- intentional? Michael Snyder
  2011-02-28  4:23 ` Joel Brobecker
@ 2011-02-28  4:47 ` Joel Brobecker
  1 sibling, 0 replies; 4+ messages in thread
From: Joel Brobecker @ 2011-02-28  4:47 UTC (permalink / raw)
  To: gdb-patches; +Cc: Joel Brobecker

Actually, I looked at the code again, and matched it against the specs
(in GCC: ada/exp_dbug.ads), and it seemed to be correct.  We might have
been able to write the code a little differently, but we need the
state-machine thingy because, for some reason, XS<number> has a different
meaning depending on whether it is preceded by an XL<number> or not.
It would have been simpler if we used XS<number> purely for subscripting
and then XU<number> for encoding the upper bound of the slice. But we're
stuck with old decisions, now (that was BMT).

I took the liberty of committing this patch, since Michael's patch
did not have a ChangeLog:

gdb/ChangeLog:

 	From Michael Snyder  <msnyder@vmware.com>
 	* ada-exp.y (write_object_renaming): Add FALLTHROUGH comment.

Checked in.

---
 gdb/ChangeLog |    5 +++++
 gdb/ada-exp.y |    1 +
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 041543b..682c9f1 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2011-02-28  Joel Brobecker  <brobecker@adacore.com>
+
+	From Michael Snyder  <msnyder@vmware.com>
+	* ada-exp.y (write_object_renaming): Add FALLTHROUGH comment.
+
 2011-02-27  Michael Snyder  <msnyder@vmware.com>
 
 	* objc-lang.c (selectors_info): Prevent string overrun.
diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y
index e56b7bc..e64d1eb 100644
--- a/gdb/ada-exp.y
+++ b/gdb/ada-exp.y
@@ -920,6 +920,7 @@ write_object_renaming (struct block *orig_left_context,
         break;
       case 'L':
 	slice_state = LOWER_BOUND;
+	/* FALLTHROUGH */
       case 'S':
 	renaming_expr += 1;
 	if (isdigit (*renaming_expr))
-- 
1.7.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [fixme] another case statement without a break -- intentional?
  2011-02-28  4:23 ` Joel Brobecker
@ 2011-02-28 18:00   ` Michael Snyder
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Snyder @ 2011-02-28 18:00 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

Joel Brobecker wrote:
>> Joel, can I ask you for a judgement call?
>> Michael
> 
> Yes, the fallthrough seems to be by-design, but I will ask Paul,
> who wrote that code.

Joel,

If it is intended, could you add a comment?

Thanks,
Michael

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-02-28 17:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-26 20:50 [fixme] another case statement without a break -- intentional? Michael Snyder
2011-02-28  4:23 ` Joel Brobecker
2011-02-28 18:00   ` Michael Snyder
2011-02-28  4:47 ` [commit] add FALLTHROUGH comment in ada-exp.y:write_object_renaming Joel Brobecker

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