This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos 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: [PATCH] Fix configuration in assert.h.


>>>>> "Sergei" == Sergei Organov <osv@javad.com> writes:

    <snip>

    >> The answer is that I intended that they should _all_ be
    >> booldata, since I want it to behave pretty much like a boolean
    >> - the interface can only be on or off, and it's easier and more
    >> conventional to use ifdefs rather than ifs for boolean macros

    Sergei> Well, here I strongly disagree. My own experience tells me
    Sergei> it's more easy and less error-prone when a boolean/numeric
    Sergei> option is always defined to something, resulting in

    Sergei> #if SOMETHING

    Sergei> or

    Sergei> #if SOMETHING > 0

    Sergei> checks instead of

    Sergei> #ifdef SOMETHING

    Sergei> One of the primary advantages is that in the former case
    Sergei> one can turn on -Wundef option of the compiler and get a
    Sergei> warning should the variable be mistyped, or corresponding
    Sergei> header with the definition is missed, or the configuration
    Sergei> option is gone. For me it's a huge helper of the same
    Sergei> power as necessity do declare variables/functions in
    Sergei> C/C++.

    Sergei> [...]

    >> I would be very grateful if you did clean up all the isoinfra options
    >> to be booldata.

    Sergei> But I'd prefer they were just data (or whatever it is
    Sergei> called) instead, so that they are always defined.

In the initial implementation CDL interfaces always had the "data"
flavor. That was found to be too limiting, so support for different
flavor interfaces was added. The default is still "data", and
individual developers can choose to stick with that based on personal
preferences.

The original CDL design called for a cdllint tool, to detect problems
like the above. It was also intended to catch other bugs, e.g.
conditionals involving CDL-like names which did not match any known
configuration options because of a typo. Unfortunately time was never
allocated to develop such a tool. Hence there will be the occasional
problem, but fortunately they seem to be infrequent.

Bart

-- 
Bart Veer                       eCos Configuration Architect
http://www.ecoscentric.com/     The eCos and RedBoot experts


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