This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

Re: PATCH to C front-end: PR 21759


"Joseph S. Myers" <joseph@codesourcery.com> writes:

| On Thu, 9 Jun 2005, Gabriel Dos Reis wrote:
| 
| > +       if (warn_cxx_compat && VOID_TYPE_P (ttr) && rhs != null_pointer_node
| > +           && !VOID_TYPE_P (ttl))
| > +         warning (OPT_Wc___compat, "request for implicit conversion from "
| > +                  "%qT to %qT not permitted in C++", rhstype, type);
| 
| It's not clear this is a case which needs the "if (warn_...) rather than 
| just controlling the warning through the first argument to warning.

Amended as per feedback from DJ.

-- Gaby
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ChangeLog,v
retrieving revision 2.9125
diff -p -r2.9125 ChangeLog
*** ChangeLog	11 Jun 2005 19:07:01 -0000	2.9125
--- ChangeLog	11 Jun 2005 19:45:18 -0000
***************
*** 1,3 ****
--- 1,8 ----
+ 2005-06-11  Gabriel Dos Reis  <gdr@integrable-solutions.net>
+ 
+ 	* c-typeck.c (convert_for_assignment): Avoid checking
+ 	OPT_Wc___compat, as it is always true.
+ 
  2005-06-11  David Edelsohn  <edelsohn@gnu.org>
  
  	* config/rs6000/rs6000.md (eq<mode>_compare): Restrict to Pmode.
Index: c-typeck.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-typeck.c,v
retrieving revision 1.452
diff -p -r1.452 c-typeck.c
*** c-typeck.c	9 Jun 2005 22:21:26 -0000	1.452
--- c-typeck.c	11 Jun 2005 19:45:22 -0000
*************** convert_for_assignment (tree type, tree 
*** 3787,3794 ****
                  int *p = NULL;
  
           where NULL is typically defined in C to be '(void *) 0'.  */
!       if (OPT_Wc___compat && VOID_TYPE_P (ttr) && rhs != null_pointer_node
!           && !VOID_TYPE_P (ttl))
          warning (OPT_Wc___compat, "request for implicit conversion from "
                   "%qT to %qT not permitted in C++", rhstype, type);
  
--- 3787,3793 ----
                  int *p = NULL;
  
           where NULL is typically defined in C to be '(void *) 0'.  */
!       if (VOID_TYPE_P (ttr) && rhs != null_pointer_node && !VOID_TYPE_P (ttl))
          warning (OPT_Wc___compat, "request for implicit conversion from "
                   "%qT to %qT not permitted in C++", rhstype, type);
  


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