This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: coding style, continuing education
- To: dewar at gnat dot com
- Subject: Re: coding style, continuing education
- From: Joerg Faschingbauer <jfasch at aon dot at>
- Date: Thu, 18 Jan 2001 22:52:31 +0100
- Cc: gcc at gcc dot gnu dot org
- References: <20010116004425.E63C834D80@nile.gnat.com>
From: dewar@gnat.com
Subject: Re: coding style, continuing education
Date: Mon, 15 Jan 2001 19:44:25 -0500 (EST)
> <<Caution -- sequence points, lazy evaluation, side effects. It's not just
> boolean algebra.
>
> Tom
> >>
>
> If this makes a difference, you are talking about seriously horrible code :-)
Bah! What about this one :-?
/* :-))) */
(
// the basic things.
(e += typespec_.matchExact (p.type())).error() ||
(e += namespec_.match (p.name())).error() ||
// either both enums are set or none.
(enumspec_.isSet() && !p.eNum().isSet() || !enumspec_.isSet() && p.eNum().isSet()) &&
(e += HW_Reason(classid,E_MATCH), 1) ||
// either both ranges are set or none.
(rangespec_.isSet() && !p.range().isSet() || !rangespec_.isSet() && p.range().isSet()) &&
(e += HW_Reason(classid,E_MATCH), 1) ||
// enum and range (if given) must match exactly.
enumspec_.isSet() && (e += enumspec_.match (p.eNum())).error() ||
rangespec_.isSet() && (e += rangespec_.match (p.range())).error() ||
// either .. or ...
(defaultspec_.isSet() && !p.def().isSet() || !defaultspec_.isSet() && p.def().isSet()) &&
(e += HW_Reason(classid,E_MATCH), 1) ||
(defaultspec_.isSet() &&
((((e += defaultspec_.value().equal(b, p.def().value())).error()) || !b) &&
(e += HW_Reason(classid,E_MATCH), 1)))
) ;
Joerg