]> gcc.gnu.org Git - gcc.git/commitdiff
c-typeck.c (emit_side_effect_warnings): Use EXPR_HAS_LOCATION instead of EXPR_LOCUS...
authorPer Bothner <per@bothner.com>
Wed, 14 Jul 2004 18:47:14 +0000 (11:47 -0700)
committerPer Bothner <bothner@gcc.gnu.org>
Wed, 14 Jul 2004 18:47:14 +0000 (11:47 -0700)
* c-typeck.c (emit_side_effect_warnings):  Use EXPR_HAS_LOCATION
instead of EXPR_LOCUS in a boolean context, which is always true
if --enable-mapped-location.
* stmt.c (warn_if_unused_value):  Likewise.  Also use EXPR_LOCATION.

From-SVN: r84698

gcc/ChangeLog
gcc/c-typeck.c
gcc/stmt.c

index 166737dd3bd6053fbd5fd47bb9509006d3f1bfce..62033604e750b842943543d011b8c5f9dace915d 100644 (file)
@@ -1,3 +1,10 @@
+2004-07-14  Per Bothner  <per@bothner.com>
+
+       * c-typeck.c (emit_side_effect_warnings):  Use EXPR_HAS_LOCATION
+       instead of EXPR_LOCUS in a boolean context, which is always true
+       if --enable-mapped-location.
+       * stmt.c (warn_if_unused_value):  Likewise.  Also use EXPR_LOCATION.
+
 2004-07-14  Richard Henderson  <rth@redhat.com>
 
        * dominance.c (struct dom_info): Add fake_exit_edge.
index 2c6df142597163ca1341077e101349059c920292..2495550ed549324618d15ce6d1dfe8928643783e 100644 (file)
@@ -6582,7 +6582,7 @@ emit_side_effect_warnings (tree expr)
     {
       if (!VOID_TYPE_P (TREE_TYPE (expr)) && !TREE_NO_WARNING (expr))
        warning ("%Hstatement with no effect",
-                EXPR_LOCUS (expr) ? EXPR_LOCUS (expr) : &input_location);
+                EXPR_HAS_LOCATION (expr) ? EXPR_LOCUS (expr) : &input_location);
     }
   else if (warn_unused_value)
     warn_if_unused_value (expr, input_location);
index e9c6e5e22960d74959e8dbd6da3ad2184a9fa090..d63dad57c3316cd26c8d420f9cb715d3da2c93e2 100644 (file)
@@ -1634,8 +1634,8 @@ warn_if_unused_value (tree exp, location_t locus)
   if (VOID_TYPE_P (TREE_TYPE (exp)))
     return 0;
 
-  if (EXPR_LOCUS (exp))
-    locus = *EXPR_LOCUS (exp);
+  if (EXPR_HAS_LOCATION (exp))
+    locus = EXPR_LOCATION (exp);
 
   switch (TREE_CODE (exp))
     {
This page took 0.085897 seconds and 5 git commands to generate.