Re: [xml] HP-UX compilation warnings for 2.6.23



Rick Jones wrote:
"xpath.c", line 11113: warning #2128-D: loop is not reachable from preceding
         code
     do {
     ^



looks buggy to me, there is a goto next_node; below the loop, and next_node is declared inside the loop, not very nice, but I think the compiler
is in error, probably worth pointing to your compiler engineers...


I extracted enough of the code there to create a test case which I've given to my compiler contact. FWIW, I tried moving next_node: just above the "do {" and that made the warning go away in the test code. I've no idea what might change semanticaly as a result...

I've been assured by my compiler contact that moving next_node: above the "do {" should be semantically equivalent, so that looks like the best way to go to resolve that:

# diff -c xpath.c.orig xpath.c
*** xpath.c.orig        Mon Feb 27 11:11:26 2006
--- xpath.c     Mon Feb 27 11:12:18 2006
***************
*** 11110,11117 ****
      }
      depth = 0;
      goto scan_children;
-     do {
  next_node:
          nb_nodes++;

        switch (cur->type) {
--- 11110,11117 ----
      }
      depth = 0;
      goto scan_children;
  next_node:
+     do {
          nb_nodes++;

        switch (cur->type) {

rick jones



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]