This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Hurd] error_t, E*, and c++


Hmm.  You need at least "#define EFOO EFOO" to make "#ifdef EFOO" work.
But one of the reasons for the current style of definition is in
particular so that "#if EAGAIN != EWOULDBLOCK" works right.  That can
only win if it's a cpp-interpretable expression, which cannot use enum
constants or syntax like casts.  (The cpp rules mean that the enum
constants are unknown identifiers and treated as zero, so any EFOO ==
EBAR comparison says they are equal.)  I am hesitant to risk breaking
any such #if expressions now compiled in C++ on Hurd.  (The error_t
usage being broken in C++ is at least not a silent change or breakage of
something that already works.)

It may also be a problem in some other C++ way I'm not aware of off
hand, for the type of EFOO not to be int.

I'm open to suggestions.  But I think we might just have to live with
C++ using (error_t) EFOO, or else supply a C++ <errno> or whatever where
there is explicitly no expectation of int-valued or cpp-usable values,
if people would actually use that.


Thanks,
Roland


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]