[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

From: Roland McGrath
Subject: Re: [Hurd] error_t, E*, and c++
Date: Mon, 26 May 2008 20:01:17 -0700 (PDT)

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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]