Index: trunk/magic/remove/configure.ac
===================================================================
--- trunk/magic/remove/configure.ac	(revision 34088)
+++ trunk/magic/remove/configure.ac	(revision 34089)
@@ -21,10 +21,11 @@
 
 dnl ------------- psLib, psModules ---------------
-PKG_CHECK_MODULES([PSLIB],    [pslib >= 1.0.0])
-PKG_CHECK_MODULES([PSMODULE], [psmodules >= 1.0.0])
+PKG_CHECK_MODULES([PSLIB],     [pslib >= 1.0.0])
+PKG_CHECK_MODULES([PSMODULE],  [psmodules >= 1.0.0])
+PKG_CHECK_MODULES([NEBCLIENT], [nebclient >= 0.17])
 
 dnl Set CFLAGS for build
 IPP_STDOPTS
-CFLAGS="${CFLAGS=} -Wall -Werror"
+dnl CFLAGS="${CFLAGS=} -Wall -Werror"
 echo "STREAKSREMOVE_CFLAGS: $STREAKSREMOVE_CFLAGS"
 echo "STREAKSREMOVE_LIBS: $STREAKSREMOVE_LIBS"
Index: trunk/magic/remove/src/Makefile.am
===================================================================
--- trunk/magic/remove/src/Makefile.am	(revision 34088)
+++ trunk/magic/remove/src/Makefile.am	(revision 34089)
@@ -24,6 +24,6 @@
 STREAKSREMOVE_CFLAGS=-DSTREAKS_COMPRESS_OUTPUT=1
 
-STREAKSCFLAGS = $(STREAKSREMOVE_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS)
-STREAKSLDFLAGS = $(STREAKSREMOVE_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS)
+STREAKSCFLAGS = $(STREAKSREMOVE_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) ${NEBCLIENT_CFLAGS}
+STREAKSLDFLAGS = $(STREAKSREMOVE_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) ${NEBCLIENT_LIBS}
 
 streaksremove_CFLAGS = $(STREAKSCFLAGS)
Index: trunk/magic/remove/src/streakscompare.c
===================================================================
--- trunk/magic/remove/src/streakscompare.c	(revision 34088)
+++ trunk/magic/remove/src/streakscompare.c	(revision 34089)
@@ -165,4 +165,6 @@
     }
 
+    if (nebulousImage) { /* do something? */ }
+
     if (argc != 1) {
         psString unexpectedArguments = NULL;
Index: trunk/magic/remove/src/streaksio.c
===================================================================
--- trunk/magic/remove/src/streaksio.c	(revision 34088)
+++ trunk/magic/remove/src/streaksio.c	(revision 34089)
@@ -659,5 +659,5 @@
 
         // Ensure input is of the expected type
-        psDataType expected = isMask ? PS_TYPE_IMAGE_MASK : PS_TYPE_F32; // Expected type for image
+        psElemType expected = isMask ? PS_TYPE_IMAGE_MASK : PS_TYPE_F32; // Expected type for image
         for (int i = 0; i < in->imagecube->n; i++) {
             psImage *image = in->imagecube->data[i]; // Image of interest
Index: trunk/magic/remove/src/streaksrelease.c
===================================================================
--- trunk/magic/remove/src/streaksrelease.c	(revision 34088)
+++ trunk/magic/remove/src/streaksrelease.c	(revision 34089)
@@ -288,13 +288,13 @@
     } else {
         // we have an image cube
-        double initValue;
+        // double initValue;
         if (exciseImageCube) {
             // copy the entire input image to the recovery image
             writeImageCube(sf->recImage, sf->inImage->imagecube, extname, sf->extnum);
-            initValue = NAN;
+            // initValue = NAN;
         } else {
             // otherwise write it to the output
             writeImageCube(sf->outImage, sf->inImage->imagecube, extname, sf->extnum);
-            initValue = 0;
+            // initValue = 0;
         }
 
Index: trunk/pedestal/configure.ac
===================================================================
--- trunk/pedestal/configure.ac	(revision 34088)
+++ trunk/pedestal/configure.ac	(revision 34089)
@@ -8,5 +8,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -20,5 +20,5 @@
 
 IPP_STDOPTS
-CFLAGS="${CFLAGS=} -Wall -Werror"
+IPP_STDCFLAGS
 
 AC_CONFIG_FILES([
Index: trunk/ppArith/configure.ac
===================================================================
--- trunk/ppArith/configure.ac	(revision 34088)
+++ trunk/ppArith/configure.ac	(revision 34089)
@@ -9,5 +9,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -24,5 +24,5 @@
 dnl Set CFLAGS for build
 IPP_STDOPTS
-CFLAGS="${CFLAGS} -Wall -Werror"
+IPP_STDCFLAGS
 
 IPP_VERSION
Index: trunk/ppBackground/configure.ac
===================================================================
--- trunk/ppBackground/configure.ac	(revision 34088)
+++ trunk/ppBackground/configure.ac	(revision 34089)
@@ -9,5 +9,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -30,5 +30,5 @@
 dnl Set CFLAGS for build
 IPP_STDOPTS
-CFLAGS="${CFLAGS} -Wall -Werror"
+IPP_STDCFLAGS
 
 IPP_VERSION
Index: trunk/ppBackground/src/ppBackgroundExit.c
===================================================================
--- trunk/ppBackground/src/ppBackgroundExit.c	(revision 34088)
+++ trunk/ppBackground/src/ppBackgroundExit.c	(revision 34089)
@@ -10,5 +10,14 @@
     }
 
-    psErrorCode errorCode = psErrorCodeLast(); // Error code
+    // gcc -Wswitch complains here if err is declared as type psErrorCode
+    // the collection of ps*ErrorCode values are enums defined separately for 
+    // each module (psphot, pswarp, etc).  the lowest type, psErrorCode is only the base set and does
+    // not include the possible psphot values
+
+    // for now, to get around this, we just use an int for the switch
+
+    // psErrorCode errorCode = psErrorCodeLast(); // Error code
+    int errorCode = psErrorCodeLast(); // Error code
+
     if (errorCode != PS_ERR_NONE) {
         pmFPAfileFreeSetStrict(false);
Index: trunk/ppConfigDump/configure.ac
===================================================================
--- trunk/ppConfigDump/configure.ac	(revision 34088)
+++ trunk/ppConfigDump/configure.ac	(revision 34089)
@@ -8,5 +8,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -21,5 +21,5 @@
 
 IPP_STDOPTS
-CFLAGS="${CFLAGS=} -Wall -Werror"
+IPP_STDCFLAGS
 
 AC_CONFIG_FILES([
Index: trunk/ppMerge/configure.ac
===================================================================
--- trunk/ppMerge/configure.ac	(revision 34088)
+++ trunk/ppMerge/configure.ac	(revision 34089)
@@ -8,5 +8,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -24,5 +24,5 @@
 
 IPP_STDOPTS
-CFLAGS="${CFLAGS=} -Wall -Werror"
+IPP_STDCFLAGS
 
 AC_CONFIG_FILES([
Index: trunk/ppNoiseMap/configure.ac
===================================================================
--- trunk/ppNoiseMap/configure.ac	(revision 34088)
+++ trunk/ppNoiseMap/configure.ac	(revision 34089)
@@ -8,5 +8,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -21,5 +21,5 @@
 
 IPP_STDOPTS
-CFLAGS="${CFLAGS=} -Wall -Werror"
+IPP_STDCFLAGS
 
 IPP_VERSION
Index: trunk/ppNorm/configure.ac
===================================================================
--- trunk/ppNorm/configure.ac	(revision 34088)
+++ trunk/ppNorm/configure.ac	(revision 34089)
@@ -8,5 +8,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -21,5 +21,5 @@
 
 IPP_STDOPTS
-CFLAGS="${CFLAGS=} -Wall -Werror"
+IPP_STDCFLAGS
 
 AC_CONFIG_FILES([
Index: trunk/ppNorm/src/ppNormCalc.c
===================================================================
--- trunk/ppNorm/src/ppNormCalc.c	(revision 34088)
+++ trunk/ppNorm/src/ppNormCalc.c	(revision 34089)
@@ -86,5 +86,5 @@
         psMetadataItem *compsItem;      // Item from iteration
         while ((compsItem = psMetadataGetAndIncrement(compsIter))) {
-            if (compsItem->type != PS_TYPE_F32) {
+            if (compsItem->type != PS_DATA_F32) {
                 psLogMsg("ppNormCalc", PS_LOG_WARN,
                          "Component %s within exposure %s is not of type F32 --- ignored.\n",
Index: trunk/ppSkycell/configure.ac
===================================================================
--- trunk/ppSkycell/configure.ac	(revision 34088)
+++ trunk/ppSkycell/configure.ac	(revision 34089)
@@ -9,5 +9,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -23,5 +23,5 @@
 dnl Set CFLAGS for build
 IPP_STDOPTS
-CFLAGS="${CFLAGS} -Wall -Werror"
+IPP_STDCFLAGS
 
 IPP_VERSION
Index: trunk/ppSmooth/configure.ac
===================================================================
--- trunk/ppSmooth/configure.ac	(revision 34088)
+++ trunk/ppSmooth/configure.ac	(revision 34089)
@@ -8,5 +8,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -21,5 +21,5 @@
 
 IPP_STDOPTS
-CFLAGS="${CFLAGS=} -Wall -Werror"
+IPP_STDCFLAGS
 
 IPP_VERSION
Index: trunk/ppStack/configure.ac
===================================================================
--- trunk/ppStack/configure.ac	(revision 34088)
+++ trunk/ppStack/configure.ac	(revision 34089)
@@ -8,5 +8,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -28,5 +28,5 @@
 
 IPP_STDOPTS
-CFLAGS="${CFLAGS=} -Wall -Werror"
+IPP_STDCFLAGS
 
 IPP_VERSION
Index: trunk/ppStack/src/ppStackConvolve.c
===================================================================
--- trunk/ppStack/src/ppStackConvolve.c	(revision 34088)
+++ trunk/ppStack/src/ppStackConvolve.c	(revision 34089)
@@ -7,5 +7,5 @@
 	psMetadataItem *item = psMetadataLookup(SOURCE->concepts, NAME); \
 	psAssert(item, "Concept should be present");			\
-	psAssert(item->type == PS_TYPE_F32, "Concept should be F32");	\
+	psAssert(item->type == PS_DATA_F32, "Concept should be F32");	\
 	item->data.F32 = VALUE;						\
     }
@@ -101,5 +101,14 @@
         if (!ppStackMatch(readout, target, options, i, config)) {
             // XXX many things can cause a failure of ppStackMatch -- should some be handled differently?
-            psErrorCode error = psErrorCodeLast(); // Error code
+
+	    // gcc -Wswitch complains here if err is declared as type psErrorCode
+	    // the collection of ps*ErrorCode values are enums defined separately for 
+	    // each module (psphot, pswarp, etc).  the lowest type, psErrorCode is only the base set and does
+	    // not include the possible psphot values
+
+	    // for now, to get around this, we just use an int for the switch
+
+	    // psErrorCode error = psErrorCodeLast(); // Error code
+	    int error = psErrorCodeLast(); // Error code
             switch (error) {
                 // Fatal errors
Index: trunk/ppStack/src/ppStackFinish.c
===================================================================
--- trunk/ppStack/src/ppStackFinish.c	(revision 34088)
+++ trunk/ppStack/src/ppStackFinish.c	(revision 34089)
@@ -45,5 +45,13 @@
     }
 
-    psErrorCode errorCode = psErrorCodeLast(); // Error code
+    // gcc -Wswitch complains here if err is declared as type psErrorCode
+    // the collection of ps*ErrorCode values are enums defined separately for 
+    // each module (psphot, pswarp, etc).  the lowest type, psErrorCode is only the base set and does
+    // not include the possible psphot values
+
+    // for now, to get around this, we just use an int for the switch
+
+    // psErrorCode errorCode = psErrorCodeLast(); // Error code
+    int errorCode = psErrorCodeLast(); // Error code
     if (errorCode == PS_ERR_NONE) {
 	return exitValue;
Index: trunk/ppStack/src/ppStackMatch.c
===================================================================
--- trunk/ppStack/src/ppStackMatch.c	(revision 34088)
+++ trunk/ppStack/src/ppStackMatch.c	(revision 34089)
@@ -460,5 +460,5 @@
             psMetadataItem *item = NULL;// Item from iteration
             while ((item = psMetadataGetAndIncrement(iter))) {
-                assert(item->type == PS_TYPE_F32);
+                assert(item->type == PS_DATA_F32);
                 float norm = item->data.F32; // Normalisation
                 sum += norm;
Index: trunk/ppStack/src/ppStackTarget.c
===================================================================
--- trunk/ppStack/src/ppStackTarget.c	(revision 34088)
+++ trunk/ppStack/src/ppStackTarget.c	(revision 34089)
@@ -191,5 +191,5 @@
 
         float norm = powf(10.0, -0.4 * options->norm->data.F32[i]); // Normalisation from stars
-        float meanVariance = bg->robustMedian * PS_SQR(norm);       // Mean variance in normalised image
+        float meanVariance = mean * PS_SQR(norm);       // Mean variance in normalised image
 
         if (meanVariance < minVariance) {
Index: trunk/ppSub/configure.ac
===================================================================
--- trunk/ppSub/configure.ac	(revision 34088)
+++ trunk/ppSub/configure.ac	(revision 34089)
@@ -9,5 +9,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -30,5 +30,5 @@
 dnl Set CFLAGS for build
 IPP_STDOPTS
-CFLAGS="${CFLAGS} -Wall -Werror"
+IPP_STDCFLAGS
 
 IPP_VERSION
Index: trunk/ppSub/src/ppSubExit.c
===================================================================
--- trunk/ppSub/src/ppSubExit.c	(revision 34088)
+++ trunk/ppSub/src/ppSubExit.c	(revision 34089)
@@ -11,5 +11,13 @@
     }
 
-    psErrorCode errorCode = psErrorCodeLast(); // Error code
+    // gcc -Wswitch complains here if err is declared as type psErrorCode
+    // the collection of ps*ErrorCode values are enums defined separately for 
+    // each module (psphot, pswarp, etc).  the lowest type, psErrorCode is only the base set and does
+    // not include the possible psphot values
+
+    // for now, to get around this, we just use an int for the switch
+
+    // psErrorCode errorCode = psErrorCodeLast(); // Error code
+    int errorCode = psErrorCodeLast(); // Error code
     if (errorCode != PS_ERR_NONE) {
         pmFPAfileFreeSetStrict(false);
Index: trunk/ppSub/src/ppSubMatchPSFs.c
===================================================================
--- trunk/ppSub/src/ppSubMatchPSFs.c	(revision 34088)
+++ trunk/ppSub/src/ppSubMatchPSFs.c	(revision 34089)
@@ -266,5 +266,5 @@
         if (!detections->allSources) {
             psFree(detections);
-            psErrorCode error = psErrorCodeLast(); // Error code
+            int error = psErrorCodeLast(); // Error code
             if (error == PM_ERR_OBJECTS) {
                 psErrorStackPrint(stderr, "Unable to match source lists");
@@ -439,5 +439,5 @@
 
     if (!success) {
-        psErrorCode error = psErrorCodeLast(); // Error code
+        int error = psErrorCodeLast(); // Error code
         if (error == PM_ERR_STAMPS) {
             psErrorStackPrint(stderr, "Unable to find stamps");
@@ -471,8 +471,8 @@
             psRegion *region = regItem->data.V; // Region of interest
             psMetadataItem *modeItem = psMetadataGetAndIncrement(modeIter); // Item with mode
-            psAssert(modeItem && modeItem->type == PS_TYPE_S32, "Expect subtraction mode");
+            psAssert(modeItem && modeItem->type == PS_DATA_S32, "Expect subtraction mode");
             pmSubtractionMode mode = modeItem->data.S32; // Subtraction mode
             psMetadataItem *normItem = psMetadataGetAndIncrement(normIter); // Item with normalisation
-            psAssert(normItem && normItem->type == PS_TYPE_F32 && isfinite(normItem->data.F32),
+            psAssert(normItem && normItem->type == PS_DATA_F32 && isfinite(normItem->data.F32),
                      "Expect normalisation");
             float norm = normItem->data.F32; // Normalisation
Index: trunk/ppTranslate/configure.ac
===================================================================
--- trunk/ppTranslate/configure.ac	(revision 34088)
+++ trunk/ppTranslate/configure.ac	(revision 34089)
@@ -10,5 +10,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -30,5 +30,5 @@
 dnl Set CFLAGS for build
 IPP_STDOPTS
-CFLAGS="${CFLAGS} -Wall -Werror"
+IPP_STDCFLAGS
 
 IPP_VERSION
Index: trunk/ppViz/configure.ac
===================================================================
--- trunk/ppViz/configure.ac	(revision 34088)
+++ trunk/ppViz/configure.ac	(revision 34089)
@@ -9,5 +9,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -23,5 +23,5 @@
 dnl Set CFLAGS for build
 IPP_STDOPTS
-CFLAGS="${CFLAGS} -Wall -Werror"
+IPP_STDCFLAGS
 
 IPP_VERSION
Index: trunk/ppbgrestore/configure.ac
===================================================================
--- trunk/ppbgrestore/configure.ac	(revision 34088)
+++ trunk/ppbgrestore/configure.ac	(revision 34089)
@@ -9,5 +9,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -32,10 +32,7 @@
 dnl Set CFLAGS for build
 IPP_STDOPTS
-CFLAGS="${CFLAGS} -Wall -Werror"
+IPP_STDCFLAGS
 
 IPP_VERSION
-
-# echo "PPSTAMP_CFLAGS: $PPSTAMP_CFLAGS"
-# echo "PPSTAMP_LIBS: $PPSTAMP_LIBS"
 
 AC_SUBST([PPSTAMP_CFLAGS])
Index: trunk/psLib/configure.ac
===================================================================
--- trunk/psLib/configure.ac	(revision 34088)
+++ trunk/psLib/configure.ac	(revision 34089)
@@ -27,5 +27,5 @@
 AC_SUBST(PSLIB_LT_VERSION,$PSLIB_LT_VERSION)
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 dnl ------------------- PERL options ---------------------
@@ -473,7 +473,5 @@
 dnl ------- enable -Werror after all of the probes have run ---------
 IPP_STDOPTS
-
-CFLAGS="${CFLAGS} -Wall -Werror"
-dnl enable POSIX/XSI and C99 compliance
+IPP_STDCFLAGS
 CFLAGS="${CFLAGS=} -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200112L"
 
Index: trunk/psLib/m4/ipp_stdopts.m4
===================================================================
--- trunk/psLib/m4/ipp_stdopts.m4	(revision 34088)
+++ trunk/psLib/m4/ipp_stdopts.m4	(revision 34089)
@@ -1,5 +1,7 @@
 
+dnl IPP_STDCFLAGS must go *after* external probes (to avoid Werror confusing things)
 AC_DEFUN([IPP_STDCFLAGS],
 [
+    dnl this section currently overrides a user-defined CFLAGS
     AC_ARG_ENABLE(optimize,
       [AS_HELP_STRING(--enable-optimize,enable compiler optimization)],
@@ -12,5 +14,45 @@
       ]
     )
+    dnl this section accepts a user-defined CFLAGS, and sets CFLAGS to the empty string if not present
+    AC_ARG_ENABLE(debug-build,
+      [AS_HELP_STRING(--enable-debug-build,enable debug build: ie disable Werror)],
+      [AC_MSG_RESULT(debug build enabled)
+        if test x"${CFLAGS}" == x; then
+          CFLAGS="-Wall"
+	else
+          CFLAGS="${CFLAGS=} -Wall"
+        fi
+      ],
+      [AC_MSG_RESULT([compile optimization disabled])
+        if test x"${CFLAGS}" == x; then
+          CFLAGS="-Wall -Werror"
+	else
+          CFLAGS="${CFLAGS=} -Wall -Werror"
+        fi
+      ]
+    )
 ])
+
+dnl IPP_STDLDFLAGS must go *before* external probes (so linking is done with --no-as-needed if needed)
+AC_DEFUN([IPP_STDLDFLAGS],
+[
+    dnl this section accepts a user-defined LDFLAGS, and sets LDFLAGS to the empty string if not present
+    AC_ARG_ENABLE(no-as-needed, 
+      [AS_HELP_STRING(--enable-no-as-needed, prevent as-needed option sometimes supplied to gcc such as Ubuntu after 11.11)],
+      [AC_MSG_RESULT(no-as-needed passed to linker) 
+      	if test x"${LDFLAGS}" == x; then
+          LDFLAGS="-Wl,--no-as-needed"
+	else
+          LDFLAGS="${LDFLAGS=} -Wl,--no-as-needed"
+	fi
+      ],
+      [AC_MSG_RESULT(as-needed linker flags accepted) 
+      	if test x"${LDFLAGS}" == x; then
+          LDFLAGS=""
+	fi
+      ]
+    )
+])
+dnl
 
 AC_DEFUN([IPP_STDOPTS],
Index: trunk/psLib/src/astro/psTime.c
===================================================================
--- trunk/psLib/src/astro/psTime.c	(revision 34088)
+++ trunk/psLib/src/astro/psTime.c	(revision 34089)
@@ -223,5 +223,4 @@
 static bool timeInit(const char *fileName)
 {
-    psS32 numLines = 0;
     bool foundTable = false;
     char *tableDir = NULL;
@@ -390,5 +389,5 @@
         if (i < numTables) {
             table = psLookupTableAlloc(fullTableName, (const char*)tableFormat, tablesIndex->data.S32[i]);
-            numLines = psLookupTableRead(table);
+            psLookupTableRead(table);
         } else {
             psError(PS_ERR_BAD_PARAMETER_VALUE, no_problem,
Index: trunk/psLib/src/fits/psFitsTable.c
===================================================================
--- trunk/psLib/src/fits/psFitsTable.c	(revision 34088)
+++ trunk/psLib/src/fits/psFitsTable.c	(revision 34089)
@@ -511,5 +511,5 @@
                 colSpec *spec = psAlloc(sizeof(colSpec)); // Specification for this column
                 // BOOL type is not a valid vector type, so we translate it to U8
-                spec->type = colItem->type == PS_TYPE_BOOL ? PS_TYPE_U8 : colItem->type;
+                spec->type = colItem->type == PS_DATA_BOOL ? PS_DATA_U8 : colItem->type;
                 spec->size = size;
                 if (colItem->type == PS_DATA_VECTOR) {
@@ -526,5 +526,5 @@
                 }
                 if (colItem->type != spec->type &&
-                    colItem->type != PS_TYPE_BOOL && spec->type != PS_TYPE_U8) {
+                    colItem->type != PS_DATA_BOOL && spec->type != PS_DATA_U8) {
                     psWarning("Differing type found for column %s: %x vs %x --- using the first found.\n",
                               colSpecItem->name, colItem->type, spec->type);
Index: trunk/psLib/src/imageops/psImageGeomManip.c
===================================================================
--- trunk/psLib/src/imageops/psImageGeomManip.c	(revision 34088)
+++ trunk/psLib/src/imageops/psImageGeomManip.c	(revision 34089)
@@ -580,5 +580,4 @@
     psS32 outRows;
     psS32 outCols;
-    psS32 elementSize;
     psElemType type;
 
@@ -594,5 +593,5 @@
     outCols = input->numCols;
     type = input->type.type;
-    elementSize = PSELEMTYPE_SIZEOF(type);
+    // XXX unused psS32 elementSize = PSELEMTYPE_SIZEOF(type);
     out = psImageRecycle(out, outCols, outRows, type);
 
Index: trunk/psLib/src/imageops/psImageInterpolate.c
===================================================================
--- trunk/psLib/src/imageops/psImageInterpolate.c	(revision 34088)
+++ trunk/psLib/src/imageops/psImageInterpolate.c	(revision 34089)
@@ -461,4 +461,10 @@
     }
 
+#define INTERPOLATE_CHECK() \
+    if (xMin < 0) { /* XXX warn or error? */ } \
+    if (yMin < 0) { /* XXX warn or error? */ } \
+    if (xMax >= image->numCols) { /* XXX warn or error? */ } \
+    if (yMax >= image->numRows) { /* XXX warn or error? */ } \
+
 // Determine the result of the interpolation after all the math has been done
 static psImageInterpolateStatus interpolateResult(const psImageInterpolation *interp,
@@ -523,4 +529,5 @@
     }
     INTERPOLATE_RANGE();
+    INTERPOLATE_CHECK();
 
     // Get the appropriate kernels
@@ -779,4 +786,5 @@
     }
     INTERPOLATE_RANGE();
+    INTERPOLATE_CHECK();
 
     // Get the appropriate kernels
@@ -989,4 +997,5 @@
     INTERPOLATE_SETUP(x, y);
     xExact = yExact = false;
+    if (xExact && yExact) { /* possible alternative */ }
 
     psF32 xKernel[size], yKernel[size]; // Interpolation kernels
@@ -1038,4 +1047,5 @@
     INTERPOLATE_SETUP(x, y);
     xExact = yExact = false;
+    if (xExact && yExact) { /* possible alternative */ }
 
     psF32 xKernel[size], yKernel[size]; // Interpolation kernels
Index: trunk/psLib/src/imageops/psImageStructManip.c
===================================================================
--- trunk/psLib/src/imageops/psImageStructManip.c	(revision 34088)
+++ trunk/psLib/src/imageops/psImageStructManip.c	(revision 34089)
@@ -212,4 +212,6 @@
     elementSize = PSELEMTYPE_SIZEOF(inDatatype);
 
+    if (0) { fprintf (stderr, "%d elements, %d total memory\n", elements, elements * elementSize); }
+
     output = p_psImageRecycle(file, lineno, func, output, numCols, numRows, type);
     P_PSIMAGE_SET_COL0(output, input->col0);
Index: trunk/psLib/src/math/psMinimizePowell.c
===================================================================
--- trunk/psLib/src/math/psMinimizePowell.c	(revision 34088)
+++ trunk/psLib/src/math/psMinimizePowell.c	(revision 34089)
@@ -367,7 +367,4 @@
     psF32 c = 0.0;
     psF32 n = 0.0;
-    psF32 fa = 0.0;
-    psF32 fb = 0.0;
-    psF32 fc = 0.0;
     psF32 fn = 0.0;
     psF32 mul = 0.0;
@@ -415,8 +412,10 @@
         PS_VECTOR_ADD_MULTIPLE(params, paramMask, line, tmpb, b);
         PS_VECTOR_ADD_MULTIPLE(params, paramMask, line, tmpc, c);
-        fa = func(tmpa, coords);
-        fb = func(tmpb, coords);
-        fc = func(tmpc, coords);
+        psF32 fb = func(tmpb, coords);
+# if (PS_TRACE_ON)
+        psF32 fa = func(tmpa, coords);
+        psF32 fc = func(tmpc, coords);
         psTrace("psLib.math", 6, "LineMin: f(%f %f %f) is (%f %f %f)\n", a, b, c, fa, fb, fc);
+# endif
 
         // We determine which is the biggest segment in [a,b,c] then split
Index: trunk/psLib/src/mathtypes/psVector.c
===================================================================
--- trunk/psLib/src/mathtypes/psVector.c	(revision 34088)
+++ trunk/psLib/src/mathtypes/psVector.c	(revision 34089)
@@ -322,13 +322,9 @@
             PSVECTOR_COPY_SAME_CASE(F32);
             PSVECTOR_COPY_SAME_CASE(F64);
-        default: {
-                char* typeStr;
-                PS_TYPE_NAME(typeStr,type);
-                psError(PS_ERR_BAD_PARAMETER_TYPE, true,
-                        //                        _("Input psVector is an unsupported type (0x%x)."), typeStr);
-                        "Input psVector is an unsupported type.\n");
-                psFree(output);
-                return NULL;
-            }
+	  default: {
+	      psError(PS_ERR_BAD_PARAMETER_TYPE, true, "Input psVector is an unsupported type.\n");
+	      psFree(output);
+	      return NULL;
+	  }
         }
         return output;
Index: trunk/psLib/src/types/psLookupTable.c
===================================================================
--- trunk/psLib/src/types/psLookupTable.c	(revision 34088)
+++ trunk/psLib/src/types/psLookupTable.c	(revision 34089)
@@ -607,5 +607,4 @@
     psU64 loIdx = 0;
     long  numRows = 0;
-    long numCols = 0;
     psF64 out = 0.0;
     psF64 denom = 0.0;
@@ -619,5 +618,4 @@
     values = table->values;
     numRows = table->index->n;
-    numCols = table->values->n;
     valuesVec = (psVector*)values->data[column];
 
Index: trunk/psLib/src/types/psMetadata.c
===================================================================
--- trunk/psLib/src/types/psMetadata.c	(revision 34088)
+++ trunk/psLib/src/types/psMetadata.c	(revision 34089)
@@ -1504,5 +1504,4 @@
               fprintf(fd, "\n");
               break;
-            case PS_DATA_UNKNOWN:
             default:
               fprintf(fd, "<Unsupported type>\n");
Index: trunk/psLib/src/types/psMetadataConfig.c
===================================================================
--- trunk/psLib/src/types/psMetadataConfig.c	(revision 34088)
+++ trunk/psLib/src/types/psMetadataConfig.c	(revision 34089)
@@ -1573,5 +1573,4 @@
             }
             break;
-        case PS_DATA_UNKNOWN:
         default:
             psError(PS_ERR_BAD_PARAMETER_VALUE, true,
Index: trunk/psLib/src/types/psMetadataItemCompare.c
===================================================================
--- trunk/psLib/src/types/psMetadataItemCompare.c	(revision 34088)
+++ trunk/psLib/src/types/psMetadataItemCompare.c	(revision 34089)
@@ -129,10 +129,11 @@
   case PS_TYPE_##COMPARETYPENAME: { \
       TEMPLATETYPE valueC = (TEMPLATETYPE)compare->data.COMPARENAME; \
-      TEMPLATETYPE valueT = (TEMPLATETYPE)template->data.TEMPLATENAME; \
-      /* XXX check the validiy of the type casting? */ \
-      if (valueC != compare->data.COMPARENAME) { \
-          return false; \
-      } \
-      COMPARE_VALUES(valueT, valueC, (template->type == PS_TYPE_F32 || template->type == PS_TYPE_F64)); \
+      TEMPLATETYPE valueT = (TEMPLATETYPE)template->data.TEMPLATENAME;	\
+      /* XXX check the validiy of the type casting? */			\
+      if (valueC != compare->data.COMPARENAME) {			\
+	return false;							\
+      }									\
+      COMPARE_VALUES(valueT, valueC, (template->type == PS_DATA_F32 || template->type == PS_DATA_F64)); \
+      /* COMPARE_VALUES(valueT, valueC, 1);				*/  \
       psAbort("Should never reach here."); \
   }
@@ -277,5 +278,5 @@
                     return false;
                 }
-                double compareValue = compare->type == PS_TYPE_F32 ? compare->data.F32 : compare->data.F64;
+                double compareValue = compare->type == PS_DATA_F32 ? compare->data.F32 : compare->data.F64;
                 COMPARE_VALUES(templateValue, compareValue, true);
             }
Index: trunk/psLib/test/tap/src/tap.c
===================================================================
--- trunk/psLib/test/tap/src/tap.c	(revision 34088)
+++ trunk/psLib/test/tap/src/tap.c	(revision 34089)
@@ -87,5 +87,6 @@
     if(test_name != NULL) {
         va_start(ap, test_name);
-        vasprintf(&local_test_name, test_name, ap);
+        int status = vasprintf(&local_test_name, test_name, ap);
+	if (status) {/* warning? */}
         va_end(ap);
 
@@ -303,5 +304,6 @@
 
     va_start(ap, fmt);
-    asprintf(&skip_msg, fmt, ap);
+    int status = asprintf(&skip_msg, fmt, ap);
+    if (status) {/* warning? */}
     va_end(ap);
 
@@ -328,5 +330,6 @@
 
     va_start(ap, fmt);
-    vasprintf(&todo_msg, fmt, ap);
+    int status = vasprintf(&todo_msg, fmt, ap);
+    if (status) {/* warning? */}
     va_end(ap);
 
Index: trunk/psastro/configure.ac
===================================================================
--- trunk/psastro/configure.ac	(revision 34088)
+++ trunk/psastro/configure.ac	(revision 34089)
@@ -9,5 +9,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -189,5 +189,6 @@
 dnl Set CFLAGS for build
 IPP_STDOPTS
-CFLAGS="${CFLAGS=} -Wall -Werror"
+IPP_STDCFLAGS
+
 echo "PSASTRO_CFLAGS: $PSASTRO_CFLAGS"
 echo "PSASTRO_LIBS: $PSASTRO_LIBS"
Index: trunk/pstamp/configure.ac
===================================================================
--- trunk/pstamp/configure.ac	(revision 34088)
+++ trunk/pstamp/configure.ac	(revision 34089)
@@ -10,5 +10,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -30,9 +30,24 @@
 PKG_CHECK_MODULES([PSMODULE], [psmodules >= 1.0.0])
 
+OHANA_CONFIG=`which ohana-config`
+
+dnl get CFLAGS for ohana
+AC_MSG_NOTICE([libohana cflags info supplied by ohana-config])
+AC_MSG_CHECKING([libohana cflags])
+OHANA_CFLAGS="`${OHANA_CONFIG} --cflags`"
+AC_MSG_RESULT([${OHANA_CFLAGS}])
+
+dnl get LDFLAGS for ohana
+AC_MSG_NOTICE([libohana ldflags info supplied by ohana-config])
+AC_MSG_CHECKING([libohana ldflags])
+OHANA_LIBS="`${OHANA_CONFIG} --libs`"
+AC_MSG_RESULT([${OHANA_LIBS}])
+
 dnl Set CFLAGS for build
 IPP_STDOPTS
-CFLAGS="${CFLAGS} -Wall -Werror"
-PPSTAMP_CFLAGS="${PSLIB_CFLAGS=} ${PSMODULES_CFLAGS=}"
-PPSTAMP_LIBS="${PSLIB_LIBS=} ${PSMODULES_LIBS=}"
+IPP_STDCFLAGS
+
+PPSTAMP_CFLAGS="${PSLIB_CFLAGS=} ${PSMODULE_CFLAGS=} ${OHANA_CFLAGS}"
+PPSTAMP_LIBS="${PSLIB_LIBS=} ${PSMODULE_LIBS=} ${OHANA_LIBS}"
 echo "PPSTAMP_CFLAGS: $PPSTAMP_CFLAGS"
 echo "PPSTAMP_LIBS: $PPSTAMP_LIBS"
Index: trunk/pstamp/src/Makefile.am
===================================================================
--- trunk/pstamp/src/Makefile.am	(revision 34088)
+++ trunk/pstamp/src/Makefile.am	(revision 34089)
@@ -9,11 +9,11 @@
         pstampErrorCodes.h
 
-ppstamp_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) 
-pstamprequest_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) 
-pstampdump_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS)
+ppstamp_CPPFLAGS = $(PPSTAMP_CFLAGS)
+pstamprequest_CPPFLAGS = $(PPSTAMP_CFLAGS)
+pstampdump_CPPFLAGS = $(PPSTAMP_CFLAGS)
 
-ppstamp_LDFLAGS = $(PSLIB_LIBS) $(PSMODULE_LIBS) 
-pstamprequest_LDFLAGS = $(PSLIB_LIBS) $(PSMODULE_LIBS) 
-pstampdump_LDFLAGS = $(PSLIB_LIBS) $(PSMODULE_LIBS)
+ppstamp_LDFLAGS = $(PPSTAMP_LIBS)
+pstamprequest_LDFLAGS = $(PPSTAMP_LIBS)
+pstampdump_LDFLAGS = $(PPSTAMP_LIBS)
 
 ppstamp_SOURCES = \
Index: trunk/pstamp/src/pstamprequest.c
===================================================================
--- trunk/pstamp/src/pstamprequest.c	(revision 34088)
+++ trunk/pstamp/src/pstamprequest.c	(revision 34089)
@@ -191,5 +191,5 @@
     bool        gotRange  = false;
     bool        needROI   = false;
-    bool        makeStamps= false;
+    // bool        makeStamps= false; XXX unused
     unsigned    optionMask = PSTAMP_SELECT_IMAGE;
 
@@ -212,5 +212,5 @@
         psMetadataAddStr (md, PS_LIST_TAIL, "JOB_TYPE", PS_META_REPLACE, "", "stamp");
         needROI = true;
-        makeStamps = true;
+        // XXX unused makeStamps = true;
     }
 
Index: trunk/psvideophot/configure.ac
===================================================================
--- trunk/psvideophot/configure.ac	(revision 34088)
+++ trunk/psvideophot/configure.ac	(revision 34089)
@@ -8,5 +8,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -24,5 +24,5 @@
 
 IPP_STDOPTS
-CFLAGS="${CFLAGS=} -Wall -Werror"
+IPP_STDCFLAGS
 
 IPP_VERSION
Index: trunk/pswarp/configure.ac
===================================================================
--- trunk/pswarp/configure.ac	(revision 34088)
+++ trunk/pswarp/configure.ac	(revision 34089)
@@ -9,5 +9,5 @@
 AM_MAINTAINER_MODE
 
-IPP_STDCFLAGS
+IPP_STDLDFLAGS
 
 AC_LANG(C)
@@ -33,5 +33,6 @@
 dnl Set CFLAGS for build
 IPP_STDOPTS
-CFLAGS="${CFLAGS} -Wall -Werror"
+IPP_STDCFLAGS
+
 echo "PSWARP_CFLAGS: $PSWARP_CFLAGS"
 echo "PSWARP_LIBS: $PSWARP_LIBS"
Index: trunk/pswarp/src/pswarpArguments.c
===================================================================
--- trunk/pswarp/src/pswarpArguments.c	(revision 34088)
+++ trunk/pswarp/src/pswarpArguments.c	(revision 34089)
@@ -28,5 +28,4 @@
 pmConfig *pswarpArguments (int argc, char **argv) {
 
-    bool status;
     int N;
 
@@ -101,5 +100,5 @@
     array = psArrayAlloc(1);
     array->data[0] = psStringCopy(argv[2]);
-    status = psMetadataAddPtr(config->arguments, PS_LIST_TAIL, "SKYCELL", PS_DATA_ARRAY, "", array);
+    psMetadataAddPtr(config->arguments, PS_LIST_TAIL, "SKYCELL", PS_DATA_ARRAY, "", array);
     psFree(array);
 
Index: trunk/pswarp/src/pswarpExit.c
===================================================================
--- trunk/pswarp/src/pswarpExit.c	(revision 34088)
+++ trunk/pswarp/src/pswarpExit.c	(revision 34089)
@@ -20,5 +20,14 @@
     }
 
-    psErrorCode errorCode = psErrorCodeLast(); // Error code
+    // gcc -Wswitch complains here if err is declared as type psErrorCode
+    // the collection of ps*ErrorCode values are enums defined separately for 
+    // each module (psphot, pswarp, etc).  the lowest type, psErrorCode is only the base set and does
+    // not include the possible psphot values
+
+    // for now, to get around this, we just use an int for the switch
+
+    // psErrorCode errorCode = psErrorCodeLast(); // Error code
+    int errorCode = psErrorCodeLast(); // Error code
+
     if (errorCode != PS_ERR_NONE) {
         pmFPAfileFreeSetStrict(false);
Index: trunk/pswarp/src/pswarpTransformReadout.c
===================================================================
--- trunk/pswarp/src/pswarpTransformReadout.c	(revision 34088)
+++ trunk/pswarp/src/pswarpTransformReadout.c	(revision 34089)
@@ -51,8 +51,8 @@
     }
 
-    int nThreads = psMetadataLookupS32(&mdok, config->arguments, "NTHREADS"); // Number of threads
-    if (!mdok) {
-        nThreads = 0;
-    }
+    // XXX unused int nThreads = psMetadataLookupS32(&mdok, config->arguments, "NTHREADS"); // Number of threads
+    // XXX unused if (!mdok) {
+    // XXX unused     nThreads = 0;
+    // XXX unused }
     float poorFrac = psMetadataLookupF32(NULL, config->arguments, "POOR.FRAC"); ///< Flux fraction for "poor"
 
