﻿id	summary	reporter	owner	description	type	status	priority	component	version	resolution	keywords	cc
171	0p not working at global scope	pabuhr		"Using 0p at global scope fails but works at local scope. 0 works at global scope.
{{{
void * realloc( void * ptr, size_t size ) { printf( ""fred\n"" ); } // C realloc

forall( dtype T | sized(T) )
T * realloc( T * ptr, size_t size ) {
    return (T *)(void *)realloc( (void *)ptr, size ); // call C realloc
}
// realloc with 0 pointer => malloc
void * r = realloc( 0p, 4 ); // works with 0, fails with 0p
int main() {
    void * r = realloc( 0p, 4 ); // works
}
}}}
{{{
CFA Version 1.0.0 (debug)
test.cfa: In function '__global_init__':
test.cfa:8:83: error: '_sizeof_Y9_75_51_DT' undeclared (first use in this function)
    8 | void * r = realloc( 0p, 4 ); // works with 0, fails with 0p
      |                                                                                   ^                  
test.cfa:8:83: note: each undeclared identifier is reported only once for each function it appears in
test.cfa:8:104: error: '_alignof_Y9_75_51_DT' undeclared (first use in this function)
    8 | void * r = realloc( 0p, 4 ); // works with 0, fails with 0p
      |                                                                                                        ^                   
}}}"	defect	closed	minor	cfa-cc	1.0	duplicate		
