bugKimwitu++ - Bugs: bug #7375, Want up-casting operators

 
 

bug #7375: Want up-casting operators

Submitter:  Martin v. Loewis <loewis>
Submitted:  Thu 22 Jan 2004 08:59:48 AM UTC
   
 
Category:  code generation Severity:  1 - Wish
Priority:  * 5 - Normal Status:  Confirmed
Assigned to:  piefel Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 22 Jan 2004 08:59:48 AM UTC, original submission:  

Recent g++ releases reject the code generated for

ausdruck: ZAHL(integer) | TEXT(casestring);
 
ausdruck combine(bool cond, int z, char *s)
{
        return cond ? ZAHL(mkinteger(z)): TEXT(mkcasestring(s));
}

with the error

error: conditional expression between distinct pointer types `
   kc::impl_ausdruck_ZAHL*' and `kc::impl_ausdruck_TEXT*' lacks a cast

This problem can be resolved by writing

return cond ? static_cast<ausdruck>(ZAHL(mkinteger(z))):            
    static_cast<ausdruck>(TEXT(mkcasestring(s)));

However, this reformulation is difficult to read,
and may be difficult to write e.g. if the kimwitu code is
generated.

To avoid this kind of problem, and assuming that one
typically does not care about the operator type, anyway,
I'd like to see a different form of the operator, e.g.
spelled as

return cond ? ZAHL_(mkinteger(z)): TEXT_(mkcasestring(s))

Martin v. Loewis <loewis>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by piefel (Updated the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-01-29 piefel StatusNone Confirmed
        Assigned toNone piefel

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code