[Monetdb-developers] [PATCH] Mx Io.c more specific errors

Stefan Manegold Stefan.Manegold at cwi.nl
Thu Aug 3 20:06:33 CEST 2006


On Thu, Aug 03, 2006 at 02:32:21PM +0200, Sjoerd Mullender wrote:
> On 2006-08-03 13:57, Fabian Groffen wrote:
> > On 03-08-2006 13:51:58 +0200, Stefan Manegold wrote:
> >> Hi,
> >>
> >> I'd stongly vote for checking your changes in --- detailed and informative
> >> error messages are more than "handy" for both developers (debugging!) and
> >> users --- in case there are any Windows related problems, we should find and
> >> solve them, not try to avoid them.
> >>
> >> I'm not sure about the error.h (it's never used (directly) in the whole
> > 
> > errno.h
> > it's effect can be mimicked by "extern int errno;", but that is a bit
> > dirty.  It is necessary to be able to access the errno variable that at
> > least all io related functions set.

indeed my fault, sorry --- and yes, we do include errno.h "blindly" without
checks or conditions, hence, it should also be available on windows:

========
MonetDB/src/common/monet_utils.mx:#include <errno.h>
MonetDB/src/modules/plain/counters.mx:#include "errno.h"
MonetDB/src/mapi/clients/C/MapiClient.mx:#include <errno.h>
========

hence, all lights are green for your checkin, I guess...

Stefan

> No, you can't use extern int errno; instead of including errno.h.  errno
> could be declared in some weird way, especially in environments that
> allow multi-threaded programs, so that it *looks* like a simple int but
> is in fact something else.  The C99 standard has this in a footnote:
> 
> The macro errno need not be the identifier of an object. It might expand
> to a modifiable lvalue resulting from a function call (for example,
> *errno()).
> 
> 
> -- 
> Sjoerd Mullender

-- 
| Dr. Stefan Manegold | mailto:Stefan.Manegold at cwi.nl |
| CWI,  P.O.Box 94079 | http://www.cwi.nl/~manegold/  |
| 1090 GB Amsterdam   | Tel.: +31 (20) 592-4212       |
| The Netherlands     | Fax : +31 (20) 592-4312       |




More information about the developers-list mailing list