Opened 19 months ago

#269 new defect

Wrong type for generics' implicit _sizeof params on 32-bit

Reported by: mlbrooks Owned by:
Priority: major Component: cfa-cc
Version: 1.0 Keywords:
Cc:

Description

forall(T)
void fred( T x ) {
    printf( "%zu\n", sizeof(T) );
    printf( "%zu\n", sizeof(x) );
}
int main() {
    char c = 'x';
    fred(c);
}

Compiling as

cfa -Wall -Werror x.cfa

Expected, actual on plg2: runs and prints 1 twice.

Actual on ruby: compilation error (twice): format ‘%zu’ expects argument of type ‘size_t’, but argument 2 has type ‘long unsigned int’

(Found by Peter, whittled by Mike.)

Change History (0)

Note: See TracTickets for help on using tickets.