IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34345


Ignore:
Timestamp:
Aug 23, 2012, 11:26:47 AM (14 years ago)
Author:
bills
Message:

Restructure code to work around apparent compiler bug where when buildling optimized
it thinks a variable may be used uninitialized.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.astro/getcoords.c

    r34342 r34345  
    5757      return (FALSE);
    5858    }
    59     if ((mosbuffer = SelectBuffer (MOSAIC, OLDBUFFER, TRUE)) == NULL) goto escape;
     59    if ((mosbuffer = SelectBuffer (MOSAIC, OLDBUFFER, TRUE)) == NULL) {
     60        // Using goto_escape triggers a compiler bug with our build flags when using gcc 4.3.2
     61        // It thinks MOSAIC may be uninitialzed even when it can't be. Just free
     62        // goto escape;
     63        free (MOSAIC);
     64        return (FALSE);
     65    }
    6066    GetCoords (&moscoords, &mosbuffer[0].header);
    6167    RegisterMosaic (&moscoords);
     
    100106  gprint (GP_ERR, "USAGE: getcoords [buffer] (crval1) (crval2) [-transform C/E/G C/E/G]\n");
    101107  gprint (GP_ERR, "generate images of the two coordinate dimensions for the image WCS\n");
    102  escape:
    103   if (MOSAIC != NULL) free (MOSAIC);
     108  // escape:
     109  // Jumping here and trying to free this here causes the compiler to fail on optimized build to fail See comments
     110  // above.
     111  // if (MOSAIC != NULL) free (MOSAIC);
    104112  return (FALSE);
    105113}
Note: See TracChangeset for help on using the changeset viewer.