c-typeck.c (build_component_ref): Turn "for" into "do ..
authorRoger Sayle <roger@eyesopen.com>
Sun, 16 Mar 2003 13:54:23 +0000 (13:54 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Sun, 16 Mar 2003 13:54:23 +0000 (13:54 +0000)
* c-typeck.c (build_component_ref):  Turn "for" into "do .. while"
to avoid "may be used uninitialized" warning on ia64-hpux.
* config/ia64/ia64-c.c: Include "tm_p.h" for function prototypes.

From-SVN: r64434

gcc/ChangeLog
gcc/c-typeck.c
gcc/config/ia64/ia64-c.c

index b8fb4cd4d31a53d05cb074b5e529a9ce6434d2db..ad268466898772a9944143bbc2572f16e9bbde2e 100644 (file)
@@ -1,3 +1,9 @@
+2003-03-16  Roger Sayle  <roger@eyesopen.com>
+
+       * c-typeck.c (build_component_ref):  Turn "for" into "do .. while"
+       to avoid "may be used uninitialized" warning on ia64-hpux.
+       * config/ia64/ia64-c.c: Include "tm_p.h" for function prototypes.
+
 2003-03-16  Andreas Jaeger  <aj@suse.de>
 
        * configure.in: Improve check for memcheck.h.
index 0d52a7c9d94908c99c4a6177e14d35a0934aa8f1..bb696e8cfefd9acce1400348bb12e7fd8663c7c2 100644 (file)
@@ -1152,7 +1152,7 @@ build_component_ref (datum, component)
         end does it - by giving the anonymous entities each a
         separate name and type, and then have build_component_ref
         recursively call itself.  We can't do that here.  */
-      for (; field; field = TREE_CHAIN (field))
+      do
        {
          tree subdatum = TREE_VALUE (field);
 
@@ -1169,7 +1169,10 @@ build_component_ref (datum, component)
            warn_deprecated_use (subdatum);
 
          datum = ref;
+
+         field = TREE_CHAIN (field);
        }
+      while (field);
 
       return ref;
     }
index bddfc2264aa5a72eb499426a6f7e515698dfec61..b95c21d4d9b62d7cadde65a11d083b5f34db9f52 100644 (file)
@@ -28,6 +28,7 @@ Boston, MA 02111-1307, USA.  */
 #include "c-common.h"
 #include "c-pragma.h"
 #include "toplev.h"
+#include "tm_p.h"
 
 static void ia64_hpux_add_pragma_builtin PARAMS ((tree func));