[csw-maintainers] Error: Ambiguous "?:" expression

Philip Brown phil at bolthole.com
Thu Mar 11 20:53:02 CET 2010


On Wed, Mar 10, 2010 at 12:55 PM, Roger Håkansson <hson at opencsw.org> wrote:
> On 2010-03-10 18:22, Philip Brown wrote:
>>
>> "else 0" ???  that's just freakin wierd.
>
> Tell me about it...
>
>
>> perhaps if you changed that to
>>
>> else return(NULL)
>
> Nope, won't work, then CC complains that "int can't be cast to tpoint".
> That's why I added "return tpoint(0,0)", tpoint(0,0) is what the constructor
> for tpoint class returns.
>

well, another solution, may be to replace the braindead hacked
#define, to be a *real* function, or in this case, two functions, and
you use the appropriate one, in the appropriate place. (hmm. could
actually keep it as a #define if you had two separate ones)

cant you cast to  (void) or something though, and that fits everything?



Another "simple" road, if even  possible, though, would be to find in
the C++ spec some simple generic language trick that allows exit from
a constructor generically, even if unhappily.

Maybe you have to do it with a throws clause, rather than a return.

or heck, forget the return, and just do exit(1). and/or use special
defines/comments that make the compiler shut up.

used to be, /* ARGSUSED */ was a nice little magic thing,, for lint at least.


More information about the maintainers mailing list