public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* egcs-980129, fixed ambiguous `else' warnings in the gcc/f/ dir.
@ 1998-02-11 18:20 Kaveh R. Ghazi
  1998-02-12  2:36 ` Richard Henderson
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Kaveh R. Ghazi @ 1998-02-11 18:20 UTC (permalink / raw)
  To: egcs

	This patch cleans up the ambiguous `else' warnings in the
egcs/gcc/f/ directory.

		--Kaveh


Wed Feb 11 14:40:36 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * com.c (type_for_mode): Add explicit braces to avoid ambiguous `else'.
 
        * expr.c (ffeexpr_type_combine): Likewise.
        (ffeexpr_reduce_): Likewise.
        (ffeexpr_declare_parenthesized_): Likewise.
 
        * src.c (ffesrc_strcmp_1ns2i): Likewise.
        (ffesrc_strcmp_2c): Likewise.
        (ffesrc_strncmp_2c): Likewise.
 
        * stb.c (ffestb_halt1_): Likewise.
        (ffestb_R90910_): Likewise.
        (ffestb_R9109_): Likewise.
 
        * stc.c (ffestc_R544_equiv_): Likewise.
 
        * std.c (ffestd_subr_copy_easy_): Likewise.
        (ffestd_R1001dump_): Likewise.
        (ffestd_R1001dump_1005_1_): Likewise.
        (ffestd_R1001dump_1005_2_): Likewise.
        (ffestd_R1001dump_1005_3_): Likewise.
        (ffestd_R1001dump_1005_4_): Likewise.
        (ffestd_R1001dump_1005_5_): Likewise.
        (ffestd_R1001dump_1010_2_): Likewise.
 
        * ste.c (ffeste_R840): Likewise.
 
        * sts.c (ffests_puttext): Likewise.
 
        * symbol.c (ffesymbol_check_token_): Likewise.
 
        * target.c (ffetarget_real1): Likewise.
        (ffetarget_real2): Likewise.
 
 

diff -r -u orig/egcs-980129/gcc/f/com.c egcs-980129/gcc/f/com.c
--- orig/egcs-980129/gcc/f/com.c	Thu Dec 18 18:11:42 1997
+++ egcs-980129/gcc/f/com.c	Tue Feb  3 15:48:22 1998
@@ -15481,10 +15481,12 @@
       {
 	if (((t = ffecom_tree_type[i][j]) != NULL_TREE)
 	    && (mode == TYPE_MODE (t)))
-	  if ((i == FFEINFO_basictypeINTEGER) && unsignedp)
-	    return ffecom_tree_type[FFEINFO_basictypeHOLLERITH][j];
-	  else
-	    return t;
+	  {
+	    if ((i == FFEINFO_basictypeINTEGER) && unsignedp)
+	      return ffecom_tree_type[FFEINFO_basictypeHOLLERITH][j];
+	    else
+	      return t;
+	  }
       }
 
   return 0;
diff -r -u orig/egcs-980129/gcc/f/expr.c egcs-980129/gcc/f/expr.c
--- orig/egcs-980129/gcc/f/expr.c	Wed Oct  1 03:27:43 1997
+++ egcs-980129/gcc/f/expr.c	Tue Feb  3 15:50:59 1998
@@ -8761,10 +8761,12 @@
   else
     {				/* The normal stuff. */
       if (nbt == lbt)
-	if (nbt == rbt)
-	  nkt = ffeinfo_kindtype_max (nbt, lkt, rkt);
-	else
-	  nkt = lkt;
+	{
+	  if (nbt == rbt)
+	    nkt = ffeinfo_kindtype_max (nbt, lkt, rkt);
+	  else
+	    nkt = lkt;
+	}
       else if (nbt == rbt)
 	nkt = rkt;
       else
@@ -10022,26 +10024,30 @@
 	      && (left_operand->previous->type != FFEEXPR_exprtypeOPERAND_)
 	      && (left_operand->previous->u.operator.op
 		  == FFEEXPR_operatorSUBTRACT_))
-	    if (left_operand->previous->type == FFEEXPR_exprtypeUNARY_)
-	      ffetarget_integer_bad_magical_precedence (left_operand->token,
-					      left_operand->previous->token,
-							operator->token);
-	    else
-	      ffetarget_integer_bad_magical_precedence_binary
-		(left_operand->token,
-		 left_operand->previous->token,
-		 operator->token);
+	    {
+	      if (left_operand->previous->type == FFEEXPR_exprtypeUNARY_)
+		ffetarget_integer_bad_magical_precedence (left_operand->token,
+							  left_operand->previous->token,
+							  operator->token);
+	      else
+		ffetarget_integer_bad_magical_precedence_binary
+		  (left_operand->token,
+		   left_operand->previous->token,
+		   operator->token);
+	    }
 	  else
 	    ffetarget_integer_bad_magical (left_operand->token);
 	}
       if ((ffebld_op (expr) == FFEBLD_opCONTER)
 	  && (ffebld_conter_orig (expr) == NULL)
 	  && ffebld_constant_is_magical (constnode = ffebld_conter (expr)))
-	if (submag)
-	  ffetarget_integer_bad_magical_binary (operand->token,
-						operator->token);
-	else
-	  ffetarget_integer_bad_magical (operand->token);
+	{
+	  if (submag)
+	    ffetarget_integer_bad_magical_binary (operand->token,
+						  operator->token);
+	  else
+	    ffetarget_integer_bad_magical (operand->token);
+	}
       ffeexpr_stack_->exprstack = left_operand->previous;	/* Pops binary-op
 								   operands off stack. */
       ffeexpr_expr_kill_ (left_operand);
@@ -17902,13 +17908,15 @@
 
 	case FFEINFO_kindENTITY:
 	  if (ffesymbol_rank (s) == 0)
-	    if (ffesymbol_basictype (s) == FFEINFO_basictypeCHARACTER)
-	      *paren_type = FFEEXPR_parentypeSUBSTRING_;
-	    else
-	      {
-		bad = TRUE;
-		*paren_type = FFEEXPR_parentypeANY_;
-	      }
+	    {
+	      if (ffesymbol_basictype (s) == FFEINFO_basictypeCHARACTER)
+		*paren_type = FFEEXPR_parentypeSUBSTRING_;
+	      else
+		{
+		  bad = TRUE;
+		  *paren_type = FFEEXPR_parentypeANY_;
+		}
+	    }
 	  else
 	    *paren_type = FFEEXPR_parentypeARRAY_;
 	  break;
@@ -18029,15 +18037,17 @@
 
 	case FFEINFO_kindENTITY:
 	  if (ffesymbol_rank (s) == 0)
-	    if (ffeexpr_stack_->context == FFEEXPR_contextEQUIVALENCE)
-	      *paren_type = FFEEXPR_parentypeEQUIVALENCE_;
-	    else if (ffesymbol_basictype (s) == FFEINFO_basictypeCHARACTER)
-	      *paren_type = FFEEXPR_parentypeSUBSTRING_;
-	    else
-	      {
-		bad = TRUE;
-		*paren_type = FFEEXPR_parentypeANY_;
-	      }
+	    {
+	      if (ffeexpr_stack_->context == FFEEXPR_contextEQUIVALENCE)
+		*paren_type = FFEEXPR_parentypeEQUIVALENCE_;
+	      else if (ffesymbol_basictype (s) == FFEINFO_basictypeCHARACTER)
+		*paren_type = FFEEXPR_parentypeSUBSTRING_;
+	      else
+		{
+		  bad = TRUE;
+		  *paren_type = FFEEXPR_parentypeANY_;
+		}
+	    }
 	  else
 	    *paren_type = FFEEXPR_parentypeARRAY_;
 	  break;
diff -r -u orig/egcs-980129/gcc/f/src.c egcs-980129/gcc/f/src.c
--- orig/egcs-980129/gcc/f/src.c	Tue Aug 12 03:47:36 1997
+++ egcs-980129/gcc/f/src.c	Tue Feb  3 16:00:29 1998
@@ -234,10 +234,12 @@
 	  c = ffesrc_toupper (c);	/* Upcase source. */
 	  d = ffesrc_toupper (*str_ic);	/* Upcase InitialCaps char. */
 	  if (c != d)
-	    if ((d != '\0') && (c < d))
-	      return -1;
-	    else
-	      return 1;
+	    {
+	      if ((d != '\0') && (c < d))
+		return -1;
+	      else
+		return 1;
+	    }
 	}
       break;
 
@@ -247,10 +249,12 @@
 	  c = ffesrc_char_source (*var);	/* Transform source. */
 	  d = ffesrc_toupper (*str_ic);	/* Transform InitialCaps char. */
 	  if (c != d)
-	    if ((d != '\0') && (c < d))
-	      return -1;
-	    else
-	      return 1;
+	    {
+	      if ((d != '\0') && (c < d))
+		return -1;
+	      else
+		return 1;
+	    }
 	}
       break;
 
@@ -260,10 +264,12 @@
 	  c = ffesrc_char_source (*var);	/* Transform source. */
 	  d = ffesrc_tolower (*str_ic);	/* Transform InitialCaps char. */
 	  if (c != d)
-	    if ((d != '\0') && (c < d))
-	      return -1;
-	    else
-	      return 1;
+	    {
+	      if ((d != '\0') && (c < d))
+		return -1;
+	      else
+		return 1;
+	    }
 	}
       break;
 
@@ -320,10 +326,12 @@
 	{
 	  c = ffesrc_toupper (*var);	/* Upcase source. */
 	  if (c != *str_uc)
-	    if ((*str_uc != '\0') && (c < *str_uc))
-	      return -1;
-	    else
-	      return 1;
+	    {
+	      if ((*str_uc != '\0') && (c < *str_uc))
+		return -1;
+	      else
+		return 1;
+	    }
 	}
       if (*str_uc == '\0')
 	return 0;
@@ -388,10 +396,12 @@
 	{
 	  c = ffesrc_toupper (*var);	/* Upcase source. */
 	  if (c != *str_uc)
-	    if (c < *str_uc)
-	      return -1;
-	    else
-	      return 1;
+	    {
+	      if (c < *str_uc)
+		return -1;
+	      else
+		return 1;
+	    }
 	}
       return 0;
 
diff -r -u orig/egcs-980129/gcc/f/stb.c egcs-980129/gcc/f/stb.c
--- orig/egcs-980129/gcc/f/stb.c	Wed Aug 27 23:20:46 1997
+++ egcs-980129/gcc/f/stb.c	Tue Feb  3 16:09:24 1998
@@ -3773,10 +3773,12 @@
     case FFELEX_typeSEMICOLON:
       ffesta_confirmed ();
       if (!ffesta_is_inhibited ())
-	if (ffesta_first_kw == FFESTR_firstSTOP)
-	  ffestc_R842 (expr, ft);
-	else
-	  ffestc_R843 (expr, ft);
+	{
+	  if (ffesta_first_kw == FFESTR_firstSTOP)
+	    ffestc_R842 (expr, ft);
+	  else
+	    ffestc_R843 (expr, ft);
+	}
       return (ffelexHandler) ffesta_zero (t);
 
     default:
@@ -15553,11 +15555,13 @@
     case FFELEX_typeCOMMA:
     case FFELEX_typeCLOSE_PAREN:
       if (expr == NULL)
-	if (ffestb_local_.read.context == FFEEXPR_contextFILEFORMAT)
-	  ffestp_file.read.read_spec[ffestb_local_.read.ix]
-	    .value_is_label = TRUE;
-	else
-	  break;
+	{
+	  if (ffestb_local_.read.context == FFEEXPR_contextFILEFORMAT)
+	    ffestp_file.read.read_spec[ffestb_local_.read.ix]
+	      .value_is_label = TRUE;
+	  else
+	    break;
+	}
       ffestp_file.read.read_spec[ffestb_local_.read.ix].value_present
 	= TRUE;
       ffestp_file.read.read_spec[ffestb_local_.read.ix].value
@@ -16169,11 +16173,13 @@
     case FFELEX_typeCOMMA:
     case FFELEX_typeCLOSE_PAREN:
       if (expr == NULL)
-	if (ffestb_local_.write.context == FFEEXPR_contextFILEFORMAT)
-	  ffestp_file.write.write_spec[ffestb_local_.write.ix]
-	    .value_is_label = TRUE;
-	else
-	  break;
+	{
+	  if (ffestb_local_.write.context == FFEEXPR_contextFILEFORMAT)
+	    ffestp_file.write.write_spec[ffestb_local_.write.ix]
+	      .value_is_label = TRUE;
+	  else
+	    break;
+	}
       ffestp_file.write.write_spec[ffestb_local_.write.ix].value_present
 	= TRUE;
       ffestp_file.write.write_spec[ffestb_local_.write.ix].value
diff -r -u orig/egcs-980129/gcc/f/stc.c egcs-980129/gcc/f/stc.c
--- orig/egcs-980129/gcc/f/stc.c	Tue Aug 12 03:47:36 1997
+++ egcs-980129/gcc/f/stc.c	Tue Feb  3 16:11:06 1998
@@ -8238,16 +8238,18 @@
   /* See if symbol has an equivalence object already. */
 
   if (ffesymbol_equiv (s) != NULL)
-    if (ffestc_local_.equiv.eq == NULL)
-      ffestc_local_.equiv.eq = ffesymbol_equiv (s);	/* New equiv obj. */
-    else if (ffestc_local_.equiv.eq != ffesymbol_equiv (s))
-      {
-	ffestc_local_.equiv.eq = ffeequiv_merge (ffesymbol_equiv (s),
-						 ffestc_local_.equiv.eq,
-						 t);
-	if (ffestc_local_.equiv.eq == NULL)
-	  ffestc_local_.equiv.ok = FALSE;	/* Couldn't merge. */
-      }
+    {
+      if (ffestc_local_.equiv.eq == NULL)
+	ffestc_local_.equiv.eq = ffesymbol_equiv (s);	/* New equiv obj. */
+      else if (ffestc_local_.equiv.eq != ffesymbol_equiv (s))
+	{
+	  ffestc_local_.equiv.eq = ffeequiv_merge (ffesymbol_equiv (s),
+						   ffestc_local_.equiv.eq,
+						   t);
+	  if (ffestc_local_.equiv.eq == NULL)
+	    ffestc_local_.equiv.ok = FALSE;	/* Couldn't merge. */
+	}
+    }
 
   if (ffesymbol_is_save (s))
     ffestc_local_.equiv.save = TRUE;
diff -r -u orig/egcs-980129/gcc/f/std.c egcs-980129/gcc/f/std.c
--- orig/egcs-980129/gcc/f/std.c	Tue Aug 12 03:47:47 1997
+++ egcs-980129/gcc/f/std.c	Tue Feb  3 16:13:34 1998
@@ -1105,13 +1105,15 @@
 	   = ffestp_file.inquire.inquire_spec[ix].kw_or_val_present)
 	  && (stmt->inquire_spec[ix].value_present
 	      = ffestp_file.inquire.inquire_spec[ix].value_present))
-	if ((stmt->inquire_spec[ix].value_is_label
-	     = ffestp_file.inquire.inquire_spec[ix].value_is_label))
-	  stmt->inquire_spec[ix].u.label
-	    = ffestp_file.inquire.inquire_spec[ix].u.label;
-	else
-	  stmt->inquire_spec[ix].u.expr
-	    = ffestp_file.inquire.inquire_spec[ix].u.expr;
+	{
+	  if ((stmt->inquire_spec[ix].value_is_label
+	       = ffestp_file.inquire.inquire_spec[ix].value_is_label))
+	    stmt->inquire_spec[ix].u.label
+	      = ffestp_file.inquire.inquire_spec[ix].u.label;
+	  else
+	    stmt->inquire_spec[ix].u.expr
+	      = ffestp_file.inquire.inquire_spec[ix].u.expr;
+	}
     }
 
   return stmt;
@@ -4356,11 +4358,13 @@
 
 	case FFESTP_formattypeFORMAT:
 	  if (next->u.R1003D.R1004.present)
-	    if (next->u.R1003D.R1004.rtexpr)
-	      ffestd_R1001error_ (next);
-	    else
-	      ffests_printf_1U (s, "%lu",
-				next->u.R1003D.R1004.u.unsigned_val);
+	    {
+	      if (next->u.R1003D.R1004.rtexpr)
+		ffestd_R1001error_ (next);
+	      else
+		ffests_printf_1U (s, "%lu",
+				  next->u.R1003D.R1004.u.unsigned_val);
+	    }
 
 	  ffests_putc (s, '(');
 	  ffestd_R1001dump_ (s, next->u.R1003D.format);
@@ -4387,18 +4391,22 @@
   assert (!f->u.R1005.R1009.present);
 
   if (f->u.R1005.R1004.present)
-    if (f->u.R1005.R1004.rtexpr)
-      ffestd_R1001error_ (f);
-    else
-      ffests_printf_1U (s, "%lu", f->u.R1005.R1004.u.unsigned_val);
+    {
+      if (f->u.R1005.R1004.rtexpr)
+	ffestd_R1001error_ (f);
+      else
+	ffests_printf_1U (s, "%lu", f->u.R1005.R1004.u.unsigned_val);
+    }
 
   ffests_puts (s, string);
 
   if (f->u.R1005.R1006.present)
-    if (f->u.R1005.R1006.rtexpr)
-      ffestd_R1001error_ (f);
-    else
-      ffests_printf_1U (s, "%lu", f->u.R1005.R1006.u.unsigned_val);
+    {
+      if (f->u.R1005.R1006.rtexpr)
+	ffestd_R1001error_ (f);
+      else
+	ffests_printf_1U (s, "%lu", f->u.R1005.R1006.u.unsigned_val);
+    }
 }
 
 /* ffestd_R1001dump_1005_2_ -- Dump a particular format
@@ -4416,10 +4424,12 @@
   assert (f->u.R1005.R1006.present);
 
   if (f->u.R1005.R1004.present)
-    if (f->u.R1005.R1004.rtexpr)
-      ffestd_R1001error_ (f);
-    else
-      ffests_printf_1U (s, "%lu", f->u.R1005.R1004.u.unsigned_val);
+    {
+      if (f->u.R1005.R1004.rtexpr)
+	ffestd_R1001error_ (f);
+      else
+	ffests_printf_1U (s, "%lu", f->u.R1005.R1004.u.unsigned_val);
+    }
 
   ffests_puts (s, string);
 
@@ -4443,10 +4453,12 @@
   assert (f->u.R1005.R1006.present);
 
   if (f->u.R1005.R1004.present)
-    if (f->u.R1005.R1004.rtexpr)
-      ffestd_R1001error_ (f);
-    else
-      ffests_printf_1U (s, "%lu", f->u.R1005.R1004.u.unsigned_val);
+    {
+      if (f->u.R1005.R1004.rtexpr)
+	ffestd_R1001error_ (f);
+      else
+	ffests_printf_1U (s, "%lu", f->u.R1005.R1004.u.unsigned_val);
+    }
 
   ffests_puts (s, string);
 
@@ -4481,10 +4493,12 @@
   assert (f->u.R1005.R1006.present);
 
   if (f->u.R1005.R1004.present)
-    if (f->u.R1005.R1004.rtexpr)
-      ffestd_R1001error_ (f);
-    else
-      ffests_printf_1U (s, "%lu", f->u.R1005.R1004.u.unsigned_val);
+    {
+      if (f->u.R1005.R1004.rtexpr)
+	ffestd_R1001error_ (f);
+      else
+	ffests_printf_1U (s, "%lu", f->u.R1005.R1004.u.unsigned_val);
+    }
 
   ffests_puts (s, string);
 
@@ -4514,10 +4528,12 @@
   assert (f->u.R1005.R1006.present);
 
   if (f->u.R1005.R1004.present)
-    if (f->u.R1005.R1004.rtexpr)
-      ffestd_R1001error_ (f);
-    else
-      ffests_printf_1U (s, "%lu", f->u.R1005.R1004.u.unsigned_val);
+    {
+      if (f->u.R1005.R1004.rtexpr)
+	ffestd_R1001error_ (f);
+      else
+	ffests_printf_1U (s, "%lu", f->u.R1005.R1004.u.unsigned_val);
+    }
 
   ffests_puts (s, string);
 
@@ -4568,10 +4584,12 @@
 ffestd_R1001dump_1010_2_ (ffests s, ffesttFormatList f, char *string)
 {
   if (f->u.R1010.val.present)
-    if (f->u.R1010.val.rtexpr)
-      ffestd_R1001error_ (f);
-    else
-      ffests_printf_1U (s, "%lu", f->u.R1010.val.u.unsigned_val);
+    {
+      if (f->u.R1010.val.rtexpr)
+	ffestd_R1001error_ (f);
+      else
+	ffests_printf_1U (s, "%lu", f->u.R1010.val.u.unsigned_val);
+    }
 
   ffests_puts (s, string);
 }
diff -r -u orig/egcs-980129/gcc/f/ste.c egcs-980129/gcc/f/ste.c
--- orig/egcs-980129/gcc/f/ste.c	Mon Nov  3 01:07:04 1997
+++ egcs-980129/gcc/f/ste.c	Tue Feb  3 16:14:42 1998
@@ -2905,22 +2905,24 @@
     ffecom_push_calltemps ();
 
     if (neg == zero)
-      if (neg == pos)
-	expand_goto (gzero);
-      else
-	{			/* IF (expr.LE.0) THEN GOTO neg/zero ELSE
-				   GOTO pos. */
-	  texpr = ffecom_expr (expr);
-	  texpr = ffecom_2 (LE_EXPR, integer_type_node,
-			    texpr,
-			    convert (TREE_TYPE (texpr),
-				     integer_zero_node));
-	  expand_start_cond (ffecom_truth_value (texpr), 0);
+      {
+	if (neg == pos)
 	  expand_goto (gzero);
-	  expand_start_else ();
-	  expand_goto (gpos);
-	  expand_end_cond ();
-	}
+	else
+	  {			/* IF (expr.LE.0) THEN GOTO neg/zero ELSE
+				   GOTO pos. */
+	    texpr = ffecom_expr (expr);
+	    texpr = ffecom_2 (LE_EXPR, integer_type_node,
+			      texpr,
+			      convert (TREE_TYPE (texpr),
+				       integer_zero_node));
+	    expand_start_cond (ffecom_truth_value (texpr), 0);
+	    expand_goto (gzero);
+	    expand_start_else ();
+	    expand_goto (gpos);
+	    expand_end_cond ();
+	  }
+      }
     else if (neg == pos)
       {				/* IF (expr.NE.0) THEN GOTO neg/pos ELSE GOTO
 				   zero. */
diff -r -u orig/egcs-980129/gcc/f/sts.c egcs-980129/gcc/f/sts.c
--- orig/egcs-980129/gcc/f/sts.c	Tue Aug 12 03:47:48 1997
+++ egcs-980129/gcc/f/sts.c	Tue Feb  3 16:15:29 1998
@@ -252,19 +252,21 @@
 
   newlen = s->len_ + length;
   if (newlen > s->max_)
-    if (s->text_ == NULL)
-      {
-	s->max_ = 40;
-	s->text_ = malloc_new_ksr (s->pool_, "ffests", s->max_);
-      }
-    else
-      {
-	newmax = s->max_ << 1;
-	while (newmax < newlen)
-	  newmax <<= 1;
-	s->text_ = malloc_resize_ksr (s->pool_, s->text_, newmax, s->max_);
-	s->max_ = newmax;
-      }
+    {
+      if (s->text_ == NULL)
+	{
+	  s->max_ = 40;
+	  s->text_ = malloc_new_ksr (s->pool_, "ffests", s->max_);
+	}
+      else
+	{
+	  newmax = s->max_ << 1;
+	  while (newmax < newlen)
+	    newmax <<= 1;
+	  s->text_ = malloc_resize_ksr (s->pool_, s->text_, newmax, s->max_);
+	  s->max_ = newmax;
+	}
+    }
 
   memcpy (s->text_ + s->len_, text, length);
   s->len_ = newlen;
diff -r -u orig/egcs-980129/gcc/f/symbol.c egcs-980129/gcc/f/symbol.c
--- orig/egcs-980129/gcc/f/symbol.c	Sun Sep 14 15:35:32 1997
+++ egcs-980129/gcc/f/symbol.c	Tue Feb  3 16:15:53 1998
@@ -170,10 +170,12 @@
     }
 
   if (bad != FFEBAD)
-    if (i >= len)
-      *c = *(ffelex_token_text (t));
-    else
-      *c = *p;
+    {
+      if (i >= len)
+	*c = *(ffelex_token_text (t));
+      else
+	*c = *p;
+    }
 
   return bad;
 }
diff -r -u orig/egcs-980129/gcc/f/target.c egcs-980129/gcc/f/target.c
--- orig/egcs-980129/gcc/f/target.c	Tue Aug 12 03:47:48 1997
+++ egcs-980129/gcc/f/target.c	Tue Feb  3 16:17:20 1998
@@ -2191,13 +2191,15 @@
   dotoktxt (exponent);
 
   if (exponent_sign != NULL)
-    if (ffelex_token_type (exponent_sign) == FFELEX_typePLUS)
-      *p++ = '+';
-    else
-      {
-	assert (ffelex_token_type (exponent_sign) == FFELEX_typeMINUS);
-	*p++ = '-';
-      }
+    {
+      if (ffelex_token_type (exponent_sign) == FFELEX_typePLUS)
+	*p++ = '+';
+      else
+	{
+	  assert (ffelex_token_type (exponent_sign) == FFELEX_typeMINUS);
+	  *p++ = '-';
+	}
+    }
 
   dotoktxt (exponent_digits);
 
@@ -2275,13 +2277,15 @@
   dotoktxtexp (exponent);
 
   if (exponent_sign != NULL)
-    if (ffelex_token_type (exponent_sign) == FFELEX_typePLUS)
-      *p++ = '+';
-    else
-      {
-	assert (ffelex_token_type (exponent_sign) == FFELEX_typeMINUS);
-	*p++ = '-';
-      }
+    {
+      if (ffelex_token_type (exponent_sign) == FFELEX_typePLUS)
+	*p++ = '+';
+      else
+	{
+	  assert (ffelex_token_type (exponent_sign) == FFELEX_typeMINUS);
+	  *p++ = '-';
+	}
+    }
 
   dotoktxt (exponent_digits);
 
--
Kaveh R. Ghazi			Project Manager / Custom Development
ghazi@caip.rutgers.edu		ICon CMT Corp.

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

* Re: egcs-980129, fixed ambiguous `else' warnings in the gcc/f/ dir.
  1998-02-11 18:20 egcs-980129, fixed ambiguous `else' warnings in the gcc/f/ dir Kaveh R. Ghazi
@ 1998-02-12  2:36 ` Richard Henderson
  1998-02-13  2:28   ` Jeffrey A Law
       [not found] ` <19980212011618.42585.cygnus.egcs@dot.cygnus.com>
  1998-02-13  2:04 ` Jeffrey A Law
  2 siblings, 1 reply; 16+ messages in thread
From: Richard Henderson @ 1998-02-12  2:36 UTC (permalink / raw)
  To: Kaveh R. Ghazi; +Cc: egcs

On Wed, Feb 11, 1998 at 04:57:39PM -0500, Kaveh R. Ghazi wrote:
> +++ egcs-980129/gcc/f/expr.c	Tue Feb  3 15:50:59 1998
> @@ -8761,10 +8761,12 @@
>    else
>      {				/* The normal stuff. */
>        if (nbt == lbt)
> -	if (nbt == rbt)
> -	  nkt = ffeinfo_kindtype_max (nbt, lkt, rkt);
> -	else
> -	  nkt = lkt;
> +	{
> +	  if (nbt == rbt)
> +	    nkt = ffeinfo_kindtype_max (nbt, lkt, rkt);
> +	  else
> +	    nkt = lkt;
> +	}
>        else if (nbt == rbt)
>  	nkt = rkt;
>        else

It would be my preference that the pieces of the patch like this,
in which the if-then-else tree is full, _not_ be installed.  This
will remind us that we should fix the bug in the warning code.


r~

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

* Re: egcs-980129, fixed ambiguous `else' warnings in the gcc/f/ dir.
       [not found] ` <19980212011618.42585.cygnus.egcs@dot.cygnus.com>
@ 1998-02-12 19:36   ` Jason Merrill
  0 siblings, 0 replies; 16+ messages in thread
From: Jason Merrill @ 1998-02-12 19:36 UTC (permalink / raw)
  To: Richard Henderson, egcs

>>>>> Richard Henderson <rth@cygnus.com> writes:

> It would be my preference that the pieces of the patch like this,
> in which the if-then-else tree is full, _not_ be installed.  This
> will remind us that we should fix the bug in the warning code.

The GNU coding standards already call for a nested if to be wrapped in
braces, regardless of whether or not it is actually ambiguous...

Jason

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

* Re: egcs-980129, fixed ambiguous `else' warnings in the gcc/f/ dir.
  1998-02-13  2:04     ` Richard Henderson
@ 1998-02-13  2:04       ` Jeffrey A Law
  0 siblings, 0 replies; 16+ messages in thread
From: Jeffrey A Law @ 1998-02-13  2:04 UTC (permalink / raw)
  To: Richard Henderson; +Cc: egcs

  In message < 19980212234151.13408@dot.cygnus.com >you write:
  > On Fri, Feb 13, 1998 at 12:23:01AM -0700, Jeffrey A Law wrote:
  > > Regardless I think the patch should have gone in.  I'm working on
  > > a testcase for the testsuite right now.
  > 
  > Both you and Jason seem to be in agreement; I'll yield the issue.
  > Go ahead and install it.
BTW, test is installed as gcc.dg/ifelse-1.c.  Expected to fail.

jeff

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

* Re: egcs-980129, fixed ambiguous `else' warnings in the gcc/f/ dir.
  1998-02-11 18:20 egcs-980129, fixed ambiguous `else' warnings in the gcc/f/ dir Kaveh R. Ghazi
  1998-02-12  2:36 ` Richard Henderson
       [not found] ` <19980212011618.42585.cygnus.egcs@dot.cygnus.com>
@ 1998-02-13  2:04 ` Jeffrey A Law
  2 siblings, 0 replies; 16+ messages in thread
From: Jeffrey A Law @ 1998-02-13  2:04 UTC (permalink / raw)
  To: Kaveh R. Ghazi; +Cc: egcs

  In message < 199802112157.QAA27162@caip.rutgers.edu >you write:
  > 	This patch cleans up the ambiguous `else' warnings in the
  > egcs/gcc/f/ directory.
Thanks.  I've installed the patch.

As I mentioned in a previous message, if the if-else warning is giving
false positives, then that's a bug and we should put a test in the testsuite
for it -- not leave in non-conforming code in the g77 backend.

Additionally, most (all?) of the changes I saw in this patch fixed
the exact kind of problem that that warning was supposed to catch ie

	if
	 if
	 else

Now, the C language says exactly how this is supposed to be parsed,  so
it is not ambigious, but it *is* poor practice to write such code and
is a violation of the GNU coding standards.  I believe this is the case
that the if-else warning is supposed to be catching...


jeff

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

* Re: egcs-980129, fixed ambiguous `else' warnings in the gcc/f/ dir.
  1998-02-13  2:28   ` Jeffrey A Law
@ 1998-02-13  2:04     ` Richard Henderson
  1998-02-13  2:04       ` Jeffrey A Law
  0 siblings, 1 reply; 16+ messages in thread
From: Richard Henderson @ 1998-02-13  2:04 UTC (permalink / raw)
  To: law; +Cc: egcs

On Fri, Feb 13, 1998 at 12:23:01AM -0700, Jeffrey A Law wrote:
> Regardless I think the patch should have gone in.  I'm working on
> a testcase for the testsuite right now.

Both you and Jason seem to be in agreement; I'll yield the issue.
Go ahead and install it.


r~

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

* Re: egcs-980129, fixed ambiguous `else' warnings in the gcc/f/ dir.
  1998-02-12  2:36 ` Richard Henderson
@ 1998-02-13  2:28   ` Jeffrey A Law
  1998-02-13  2:04     ` Richard Henderson
  0 siblings, 1 reply; 16+ messages in thread
From: Jeffrey A Law @ 1998-02-13  2:28 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Kaveh R. Ghazi, egcs

  In message < 19980212011618.42585@dot.cygnus.com >you write:
  > On Wed, Feb 11, 1998 at 04:57:39PM -0500, Kaveh R. Ghazi wrote:
  > > +++ egcs-980129/gcc/f/expr.c	Tue Feb  3 15:50:59 1998
  > > @@ -8761,10 +8761,12 @@
  > >    else
  > >      {				/* The normal stuff. */
  > >        if (nbt == lbt)
  > > -	if (nbt == rbt)
  > > -	  nkt = ffeinfo_kindtype_max (nbt, lkt, rkt);
  > > -	else
  > > -	  nkt = lkt;
  > > +	{
  > > +	  if (nbt == rbt)
  > > +	    nkt = ffeinfo_kindtype_max (nbt, lkt, rkt);
  > > +	  else
  > > +	    nkt = lkt;
  > > +	}
  > >        else if (nbt == rbt)
  > >  	nkt = rkt;
  > >        else
  > 
  > It would be my preference that the pieces of the patch like this,
  > in which the if-then-else tree is full, _not_ be installed.  This
  > will remind us that we should fix the bug in the warning code.
Ah, I see where it's giving a false positive.  I may have missed the
trailing else when looking at the patches.

Regardless I think the patch should have gone in.  I'm working on
a testcase for the testsuite right now.
jeff

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

* Re: egcs-980129, fixed ambiguous `else' warnings in the gcc/f/ dir.
  1998-02-16  4:57 ` Bernd Schmidt
@ 1998-02-17 23:59   ` Jeffrey A Law
  0 siblings, 0 replies; 16+ messages in thread
From: Jeffrey A Law @ 1998-02-17 23:59 UTC (permalink / raw)
  To: Bernd Schmidt; +Cc: Kaveh R. Ghazi, egcs, rth

  In message <Pine.SOL.3.90.980216135224.24718C-100000@ohara.informatik.rwth-aa
chen.de>you write:
  > 	* c-common.c (c_expand_start_cond, c_expand_end_cond,
  > 	c_expand_start_else): Don't warn about non-ambiguous else even if
  > 	braces are missing.
I've installed this patch.

Note if you want to warn for those unambigious cases you might
consider using a tri-state variable to control the warnings.

-Wall would set it to the default value (don't warn if the if-else
tree is full), while another option would warn, even if the if-else
tree was full.

I think there's already some warnings that work in this manner, so
it would probably be possible to steal code from them...

Thanks!

jeff

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

* Re: egcs-980129, fixed ambiguous `else' warnings in the gcc/f/ dir.
  1998-02-13 10:58 Kaveh R. Ghazi
@ 1998-02-16  4:57 ` Bernd Schmidt
  1998-02-17 23:59   ` Jeffrey A Law
  0 siblings, 1 reply; 16+ messages in thread
From: Bernd Schmidt @ 1998-02-16  4:57 UTC (permalink / raw)
  To: Kaveh R. Ghazi; +Cc: egcs, rth

> 
> 	Lot's of gcc's warnings emit diagnostics about things that are
> coding style issues, not actual problems.
> 
> 	So given that the GNU coding standards mention this particular
> case, perhaps whatever fix you decide on should simply change the
> wording but still say something even when an if-then-else tree is full. 
> I recommend "Suggest braces around nested if-then-else." or something
> similar. 

I'm including a patch that changes the behaviour, and a small testcase that
shows which constructs are warned about and which aren't.
Personally, I find the old behaviour more useful, but whatever solution
people agree upon is fine with me.

Bernd

-- test case
static int foo, bar, baz;

void a () {}
void b () {}

void warnings ()
{
  int i;

  if (foo)
    if (bar)
      a ();
  else
    b ();

  if (foo)
    for (i = 0; i < 10; i++)
      if (bar)
	a ();
  else
    b ();

  if (foo)
    while (foo)
      if (bar)
	a ();
  else
    b ();

}

void no_warnings ()
{
  if (foo)
    {
      if (bar)
	a ();
      else
	b ();
    }

  if (foo)
    a ();
  else if (bar)
    b ();
  else if (baz)
    a ();

  if (foo)
    do
      if (bar)
        a ();
      else
        b ();
    while (foo);

  if (foo)
    if (bar)
      a ();
    else
      b ();
  else
    b ();
}

-- patch

	* c-common.c (c_expand_start_cond, c_expand_end_cond,
	c_expand_start_else): Don't warn about non-ambiguous else even if
	braces are missing.

*** c-common.c	1998/02/05 15:47:17	1.1.3.2
--- c-common.c	1998/02/13 15:45:10
*************** static void add_attribute		PROTO((enum a
*** 51,59 ****
  static void init_attributes		PROTO((void));
  static void record_international_format	PROTO((tree, tree, int));
  
! /* Keep a stack of if statements.  The value recorded is the number of
!    compound statements seen up to the if keyword.  */
! static int *if_stack;
  
  /* Amount of space in the if statement stack.  */
  static int if_stack_space = 0;
--- 51,70 ----
  static void init_attributes		PROTO((void));
  static void record_international_format	PROTO((tree, tree, int));
  
! /* Keep a stack of if statements.  We record the number of compound
!    statements seen up to the if keyword, as well as the line number
!    and file of the if.  If a potentially ambiguous else is seen, that
!    fact is recorded; the warning is issued when we can be sure that
!    the enclosing if statement does not have an else branch.  */
! typedef struct
! {
!   int compstmt_count;
!   int line;
!   char *file;
!   int needs_warning;
! } if_elt;
! 
! static if_elt *if_stack;
  
  /* Amount of space in the if statement stack.  */
  static int if_stack_space = 0;
*************** static int if_stack_space = 0;
*** 61,66 ****
--- 72,80 ----
  /* Stack pointer.  */
  static int if_stack_pointer = 0;
  
+ /* Generate RTL for the start of an if-then, and record the start of it
+    for ambiguous else detection.  */
+ 
  void
  c_expand_start_cond (cond, exitflag, compstmt_count)
       tree cond;
*************** c_expand_start_cond (cond, exitflag, com
*** 71,107 ****
    if (if_stack_space == 0)
      {
        if_stack_space = 10;
!       if_stack = (int *)xmalloc (10 * sizeof (int));
      }
    else if (if_stack_space == if_stack_pointer)
      {
        if_stack_space += 10;
!       if_stack = (int *)xrealloc (if_stack, if_stack_space * sizeof (int));
      }
!   
    /* Record this if statement.  */
!   if_stack[if_stack_pointer++] = compstmt_count;
  
    expand_start_cond (cond, exitflag);
  }
  
  void
  c_expand_end_cond ()
  {
    if_stack_pointer--;
    expand_end_cond ();
  }
  
  void
  c_expand_start_else ()
  {
    if (warn_parentheses
        && if_stack_pointer > 1
!       && if_stack[if_stack_pointer - 1] == if_stack[if_stack_pointer - 2])
!     warning ("suggest explicit braces to avoid ambiguous `else'");
!   
!   /* This if statement can no longer cause a dangling else.  */
!   if_stack[if_stack_pointer - 1]--;
  
    expand_start_else ();
  }
--- 85,141 ----
    if (if_stack_space == 0)
      {
        if_stack_space = 10;
!       if_stack = (if_elt *)xmalloc (10 * sizeof (if_elt));
      }
    else if (if_stack_space == if_stack_pointer)
      {
        if_stack_space += 10;
!       if_stack = (if_elt *)xrealloc (if_stack, if_stack_space * sizeof (if_elt));
      }
! 
    /* Record this if statement.  */
!   if_stack[if_stack_pointer].compstmt_count = compstmt_count;
!   if_stack[if_stack_pointer].file = input_filename;
!   if_stack[if_stack_pointer].line = lineno;
!   if_stack[if_stack_pointer].needs_warning = 0;
!   if_stack_pointer++;
  
    expand_start_cond (cond, exitflag);
  }
  
+ /* Generate RTL for the end of an if-then.  Optionally warn if a nested
+    if statement had an ambiguous else clause.  */
+ 
  void
  c_expand_end_cond ()
  {
    if_stack_pointer--;
+   if (if_stack[if_stack_pointer].needs_warning)
+     warning_with_file_and_line (if_stack[if_stack_pointer].file,
+ 				if_stack[if_stack_pointer].line,
+ 				"suggest explicit braces to avoid ambiguous `else'");
    expand_end_cond ();
  }
  
+ /* Generate RTL between the then-clause and the else-clause
+    of an if-then-else.  */
+ 
  void
  c_expand_start_else ()
  {
+   /* An ambiguous else warning must be generated for the enclosing if
+      statement, unless we see an else branch for that one, too.  */
    if (warn_parentheses
        && if_stack_pointer > 1
!       && (if_stack[if_stack_pointer - 1].compstmt_count
! 	  == if_stack[if_stack_pointer - 2].compstmt_count))
!     if_stack[if_stack_pointer - 2].needs_warning = 1;
! 
!   /* Even if a nested if statement had an else branch, it can't be
!      ambiguous if this one also has an else.  So don't warn in that
!      case.  Also don't warn for any if statements nested in this else.  */
!   if_stack[if_stack_pointer - 1].needs_warning = 0;
!   if_stack[if_stack_pointer - 1].compstmt_count--;
  
    expand_start_else ();
  }

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

* Re: egcs-980129, fixed ambiguous `else' warnings in the gcc/f/ dir.
@ 1998-02-13 10:58 Kaveh R. Ghazi
  1998-02-16  4:57 ` Bernd Schmidt
  0 siblings, 1 reply; 16+ messages in thread
From: Kaveh R. Ghazi @ 1998-02-13 10:58 UTC (permalink / raw)
  To: crux; +Cc: egcs, rth

 > From: Bernd Schmidt <crux@Pool.Informatik.RWTH-Aachen.DE>
 > 
 > >  > Coding style aside, the warning tells you that it is ambiguous when
 > >  > it is not.  If the tree is full, there is exactly one way it can be
 > >  > parsed.  Thus, a bug, IMO.
 > >  > r~
 > > 
 > >       Okay, then we should leave in all of them until its fixed.  That
 > > way when the fix is in, we see that the ones that should be noisy are
 > > still there and the ones that should be quiet are gone. 
 > > 
 > >       Is anyone (the original author) working on this?
 >  
 > I'll submit a fix for this on Monday.
 > Bernd

	Lot's of gcc's warnings emit diagnostics about things that are
coding style issues, not actual problems.

	So given that the GNU coding standards mention this particular
case, perhaps whatever fix you decide on should simply change the
wording but still say something even when an if-then-else tree is full. 
I recommend "Suggest braces around nested if-then-else." or something
similar. 

	This would be similar to the suggestion for parens around
assignments used as truth values. 

		--Kaveh
--
Kaveh R. Ghazi			Project Manager / Custom Development
ghazi@caip.rutgers.edu		ICon CMT Corp.

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

* Re: egcs-980129, fixed ambiguous `else' warnings in the gcc/f/ dir.
  1998-02-12 20:07 Kaveh R. Ghazi
@ 1998-02-13 10:31 ` Bernd Schmidt
  0 siblings, 0 replies; 16+ messages in thread
From: Bernd Schmidt @ 1998-02-13 10:31 UTC (permalink / raw)
  To: Kaveh R. Ghazi; +Cc: rth, egcs

>  > On Thu, Feb 12, 1998 at 01:30:19PM -0500, Kaveh R. Ghazi wrote:
>  > >       Is it a bug or a feature?  Ie, is it good coding style to not
>  > > use braces even if the if-then-else tree is full?
>  >  
>  > Coding style aside, the warning tells you that it is ambiguous when
>  > it is not.  If the tree is full, there is exactly one way it can be
>  > parsed.  Thus, a bug, IMO.
>  > r~
> 
> 	Okay, then we should leave in all of them until its fixed.  That
> way when the fix is in, we see that the ones that should be noisy are
> still there and the ones that should be quiet are gone. 
> 
> 	Is anyone (the original author) working on this?

I'll submit a fix for this on Monday.

Bernd

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

* Re: egcs-980129, fixed ambiguous `else' warnings in the gcc/f/ dir.
  1998-02-12 20:07 ` Richard Henderson
  1998-02-13  2:04   ` Jeffrey A Law
@ 1998-02-13  2:28   ` Andreas Schwab
  1 sibling, 0 replies; 16+ messages in thread
From: Andreas Schwab @ 1998-02-13  2:28 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Kaveh R. Ghazi, egcs

Richard Henderson <rth@cygnus.com> writes:

|> On Thu, Feb 12, 1998 at 01:30:19PM -0500, Kaveh R. Ghazi wrote:
|>> 	Is it a bug or a feature?  Ie, is it good coding style to not
|>> use braces even if the if-then-else tree is full?

|> Coding style aside, the warning tells you that it is ambiguous when
|> it is not.  If the tree is full, there is exactly one way it can be
|> parsed.  Thus, a bug, IMO.

Given the rules for resolving ambiguous else there is _always_ exactly one
way this can be parsed, even if it is not a full if-then-else tree.
Otherwise you would not be able to write it in the first place.  After
all, this is only a warning, and will also protect you against future
changes that may make it ambiguous again.

Andreas.

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

* Re: egcs-980129, fixed ambiguous `else' warnings in the gcc/f/ dir.
  1998-02-12 20:07 ` Richard Henderson
@ 1998-02-13  2:04   ` Jeffrey A Law
  1998-02-13  2:28   ` Andreas Schwab
  1 sibling, 0 replies; 16+ messages in thread
From: Jeffrey A Law @ 1998-02-13  2:04 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Kaveh R. Ghazi, egcs

  In message < 19980212104038.04732@dot.cygnus.com >you write:
  > On Thu, Feb 12, 1998 at 01:30:19PM -0500, Kaveh R. Ghazi wrote:
  > > 	Is it a bug or a feature?  Ie, is it good coding style to not
  > > use braces even if the if-then-else tree is full?
  > 
  > Coding style aside, the warning tells you that it is ambiguous when
  > it is not.  If the tree is full, there is exactly one way it can be
  > parsed.  Thus, a bug, IMO.
Yes, it's a bug.  But instead of leaving non-conforming code in the
compiler why don't we add a test to the testsuite?

jeff

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

* Re: egcs-980129, fixed ambiguous `else' warnings in the gcc/f/ dir.
@ 1998-02-12 20:07 Kaveh R. Ghazi
  1998-02-12 20:07 ` Richard Henderson
  0 siblings, 1 reply; 16+ messages in thread
From: Kaveh R. Ghazi @ 1998-02-12 20:07 UTC (permalink / raw)
  To: rth; +Cc: egcs

 > From: Richard Henderson <rth@cygnus.com>
 > 
 > On Wed, Feb 11, 1998 at 04:57:39PM -0500, Kaveh R. Ghazi wrote:
 > > +++ egcs-980129/gcc/f/expr.c  Tue Feb  3 15:50:59 1998
 > > @@ -8761,10 +8761,12 @@
 > >    else
 > >      {                                /* The normal stuff. */
 > >        if (nbt == lbt)
 > > -     if (nbt == rbt)
 > > -       nkt = ffeinfo_kindtype_max (nbt, lkt, rkt);
 > > -     else
 > > -       nkt = lkt;
 > > +     {
 > > +       if (nbt == rbt)
 > > +         nkt = ffeinfo_kindtype_max (nbt, lkt, rkt);
 > > +       else
 > > +         nkt = lkt;
 > > +     }
 > >        else if (nbt == rbt)
 > >       nkt = rkt;
 > >        else
 >  
 > It would be my preference that the pieces of the patch like this,
 > in which the if-then-else tree is full, _not_ be installed.  This
 > will remind us that we should fix the bug in the warning code.
 > r~

	Is it a bug or a feature?  Ie, is it good coding style to not
use braces even if the if-then-else tree is full?

		--Kaveh
--
Kaveh R. Ghazi			Project Manager / Custom Development
ghazi@caip.rutgers.edu		ICon CMT Corp.

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

* Re: egcs-980129, fixed ambiguous `else' warnings in the gcc/f/ dir.
@ 1998-02-12 20:07 Kaveh R. Ghazi
  1998-02-13 10:31 ` Bernd Schmidt
  0 siblings, 1 reply; 16+ messages in thread
From: Kaveh R. Ghazi @ 1998-02-12 20:07 UTC (permalink / raw)
  To: rth; +Cc: egcs

 > On Thu, Feb 12, 1998 at 01:30:19PM -0500, Kaveh R. Ghazi wrote:
 > >       Is it a bug or a feature?  Ie, is it good coding style to not
 > > use braces even if the if-then-else tree is full?
 >  
 > Coding style aside, the warning tells you that it is ambiguous when
 > it is not.  If the tree is full, there is exactly one way it can be
 > parsed.  Thus, a bug, IMO.
 > r~

	Okay, then we should leave in all of them until its fixed.  That
way when the fix is in, we see that the ones that should be noisy are
still there and the ones that should be quiet are gone. 

	Is anyone (the original author) working on this?

		--Kaveh
--
Kaveh R. Ghazi			Project Manager / Custom Development
ghazi@caip.rutgers.edu		ICon CMT Corp.

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

* Re: egcs-980129, fixed ambiguous `else' warnings in the gcc/f/ dir.
  1998-02-12 20:07 Kaveh R. Ghazi
@ 1998-02-12 20:07 ` Richard Henderson
  1998-02-13  2:04   ` Jeffrey A Law
  1998-02-13  2:28   ` Andreas Schwab
  0 siblings, 2 replies; 16+ messages in thread
From: Richard Henderson @ 1998-02-12 20:07 UTC (permalink / raw)
  To: Kaveh R. Ghazi; +Cc: rth, egcs

On Thu, Feb 12, 1998 at 01:30:19PM -0500, Kaveh R. Ghazi wrote:
> 	Is it a bug or a feature?  Ie, is it good coding style to not
> use braces even if the if-then-else tree is full?

Coding style aside, the warning tells you that it is ambiguous when
it is not.  If the tree is full, there is exactly one way it can be
parsed.  Thus, a bug, IMO.


r~

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

end of thread, other threads:[~1998-02-17 23:59 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-02-11 18:20 egcs-980129, fixed ambiguous `else' warnings in the gcc/f/ dir Kaveh R. Ghazi
1998-02-12  2:36 ` Richard Henderson
1998-02-13  2:28   ` Jeffrey A Law
1998-02-13  2:04     ` Richard Henderson
1998-02-13  2:04       ` Jeffrey A Law
     [not found] ` <19980212011618.42585.cygnus.egcs@dot.cygnus.com>
1998-02-12 19:36   ` Jason Merrill
1998-02-13  2:04 ` Jeffrey A Law
1998-02-12 20:07 Kaveh R. Ghazi
1998-02-12 20:07 ` Richard Henderson
1998-02-13  2:04   ` Jeffrey A Law
1998-02-13  2:28   ` Andreas Schwab
1998-02-12 20:07 Kaveh R. Ghazi
1998-02-13 10:31 ` Bernd Schmidt
1998-02-13 10:58 Kaveh R. Ghazi
1998-02-16  4:57 ` Bernd Schmidt
1998-02-17 23:59   ` Jeffrey A Law

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