[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-gsl] Erroneous use of GSL_ERROR_NULL instead of GSL_ERROR macro
From: |
Ofenloch, Oliver |
Subject: |
Re: [Bug-gsl] Erroneous use of GSL_ERROR_NULL instead of GSL_ERROR macro |
Date: |
Fri, 10 Jul 2015 07:43:07 +0000 |
Hi, Matthias!
I read your emails about the GSL_ERROR_NULL macro. Wouldn't it be enough to
simply change the macro to
#define GSL_ERROR_NULL(reason, gsl_errno) GSL_ERROR_VAL(reason, gsl_errno, 1)
With that modification, the macro would expand to
do { \
gsl_error ("gsl_odeiv2_system dimension must be a positive integer",
"/home/ofenloch/teben2/gsl/ode-initval2/driver.c", 61, GSL_EINVAL) ; \
return 1 ; \
} while (0)
Shouldn't that do the trick?
Best regards
Oliver
-----Ursprüngliche Nachricht-----
Von: address@hidden [mailto:address@hidden Im Auftrag von Matthias Sitte
Gesendet: Freitag, 10. Juli 2015 05:17
An: address@hidden
Betreff: [Bug-gsl] Erroneous use of GSL_ERROR_NULL instead of GSL_ERROR macro
Hi list,
in reference to my previous email I dug through the whole code base, checking
each function that the 'git grep -n -p "GSL_ERROR_NULL"' returned. Thankfully,
only a couple of more functions turned up which use GSL_ERROR_NULL instead of
GSL_ERROR. Although this might not seem relevant at first, remember that
GSL_SUCCESS equals to 0 as does NULL returned by GSL_ERROR_NULL, so there's no
way of knowing that those functions might fail if you use a custom error
handler which doesn't automatically abort.
Anyway, patch attached. If you prefer pull requests instead, let me know.
Cheers,
Matthias