af426c7aa40aad4c5c6b532b02a1151dd42da305 galt Wed Jun 4 15:17:14 2014 -0700 Inside an errCatch block warnings which are not followed by an errAbort just get swallowed up and ignored. I added a flag to the structure that remembers that warnings have occurred. diff --git src/inc/errCatch.h src/inc/errCatch.h index a9bfc1e..bcaec62 100644 --- src/inc/errCatch.h +++ src/inc/errCatch.h @@ -15,42 +15,47 @@ */ #ifndef ERRCATCH_H #define ERRCATCH_H #ifndef DYSTRING_H #include "dystring.h" #endif struct errCatch /* Something to help catch errors. */ { struct errCatch *next; /* Next in stack. */ jmp_buf jmpBuf; /* Where to jump back to for recovery. */ struct dyString *message; /* Error message if any */ boolean gotError; /* Some sort of error was caught. */ + boolean gotWarning; /* Some sort of error warning was raised. */ }; struct errCatch *errCatchNew(); /* Return new error catching structure. */ void errCatchFree(struct errCatch **pErrCatch); /* Free up resources associated with errCatch */ #define errCatchStart(e) (errCatchPushHandlers(e) && setjmp(e->jmpBuf) == 0) /* Little wrapper around setjmp. This returns TRUE * on the main execution thread, FALSE after abort. */ boolean errCatchPushHandlers(struct errCatch *errCatch); /* Push error handlers. Not usually called directly. * but rather through errCatchStart() macro. Always * returns TRUE. */ void errCatchEnd(struct errCatch *errCatch); /* Restore error handlers and pop self off of catching stack. */ +void errCatchReWarn(struct errCatch *errCatch); +/* Re-warn any warnings that happened even though no abort happened + * to make them visible. */ + boolean errCatchFinish(struct errCatch **pErrCatch); /* Finish up error catching. Report error if there is a * problem and return FALSE. If no problem return TRUE. * This handles errCatchEnd and errCatchFree. */ #endif /* ERRCATCH_H */