View Issue Details

IDProjectCategoryView StatusLast Update
0000041LDMud 3.2-devLPC Compiler/Preprocessorpublic2004-05-17 07:27
Reportermenaures Assigned Tolars 
PrioritynormalSeveritytrivialReproducibilityN/A
Status closedResolutionfixed 
Summary0000041: typechecking issues
DescriptionHave any kind of macro that operates on different data types. How do you compile this in newer 3.2.10-dev drivers without errors and warnings?

The only solution I found was turning off warn_empty_casts, because I used (mixed) to overcome the typechecking issues. However, it is sad to have to turn all the empty_casts warnings off, only because I have to use mixed->mixed casts.

Maybe there should always be a legitimate way to turn off the drivers typechecking for a local value, for example by always allowing (mixed) (or ({mixed})?) casts on any type.

Or is there another solution?

Code:
---- 8< ----
#define MACRO(x) (intp(x) && (x) == i || stringp(x) && x == str || objectp(x) && (x) == ob || pointerp(x)
&& (x) == arr || mappingp(x) && (x) == map /*|| ...*/)

void foo()
{
    object ob;
    int i;
    string str, * arr;
    mapping map;
    /* ... */
    mixed x;
    

    MACRO(ob);
    MACRO(i);
    MACRO(str);
    MACRO(arr);
    MACRO(map);
    MACRO(x);
}
---- 8< ----
TagsNo tags attached.

Activities

lars

2004-04-03 15:32

reporter   ~0000040

Casting a mixed type to 'mixed' no longer produces a warning; this type of cast was never associated with a type conversion anyway.

Fixed in 3.2-dev.623 and 3.3.508.

Issue History

Date Modified Username Field Change
2004-01-02 02:30 menaures New Issue
2004-04-03 15:32 lars Status new => resolved
2004-04-03 15:32 lars Resolution open => fixed
2004-04-03 15:32 lars Assigned To => lars
2004-04-03 15:32 lars Note Added: 0000040
2004-05-17 07:27 lars Status resolved => closed