INFO: No output directory specified (--dir) INFO: Using directory: "SESANS_Delft_20250814_160220" INFO: Regenerating c-file: SESANS_Delft.c DEBUG: CMD: /home/willend/micromamba/bin/mcstas -t -o ./SESANS_Delft.c SESANS_Delft.instr Info: 'Foil_flipper_magnet' is a contributed component. CFLAGS= ----------------------------------------------------------- Generating single GPU kernel or single CPU section layout: ----------------------------------------------------------- Generating GPU/CPU -DFUNNEL layout: ----------------------------------------------------------- DEBUG: CMD: /home/willend/micromamba/bin/mcstas finished INFO: Linting generated code: ./SESANS_Delft.c DEBUG: CMD: cppcheck ./SESANS_Delft.c --check-level=exhaustive --force -DMCDEFAULT_NCOUNT=1000000 -UMC_PORTABLE -DND_BUFFER=10000000 -UNOABSORB_INF_NAN -UOMPI_MPI_H -DSIGABRT -DSIGBREAK -DSIGBUS -DSIGPE -DSIGHUP -DSIGILL -DSIGINT -DSIGKILL -DSIGUSR1 -DSIGUSR2 -DSIGPIPE -DSIGQUIT -DSIGSEGV -DSIGTRAP -DSIGURG -DSIGFPE -DSIGKILL -DSIGTERM -UTEST -UUSE_OPENCL -UWIN32 -UOPENACC -UGCCOFFLOAD -U_MSC_VER -U_MSC_EXTENSIONS -U_WIN32 -UWIN32 -D__unix__ -UDANSE -UFUNNEL -UMC_ANCIENT_COMPATIBILITY -UMC_POL_COMPAT -UNEUTRONICS -Uisnan -Uisinf Checking SESANS_Delft.c ... Checking SESANS_Delft.c: MCDEFAULT_NCOUNT=1000000;ND_BUFFER=10000000;SIGABRT=1;SIGBREAK=1;SIGBUS=1;SIGPE=1;SIGHUP=1;SIGILL=1;SIGINT=1;SIGKILL=1;SIGUSR1=1;SIGUSR2=1;SIGPIPE=1;SIGQUIT=1;SIGSEGV=1;SIGTRAP=1;SIGURG=1;SIGFPE=1;SIGKILL=1;SIGTERM=1;__unix__=1... SESANS_Delft.c:10057:5: error: Found an exit path from function with non-void return type that has missing return statement [missingReturn] b=exp(- fabs(z-prms[3])); ^ SESANS_Delft.c:9086:3: warning: If memory allocation fails, then there is a possible null pointer dereference: node [nullPointerOutOfMemory] node->depth = depth; ^ SESANS_Delft.c:9085:26: note: Assuming allocation function fails treeNode *node = malloc(sizeof(treeNode)); ^ SESANS_Delft.c:9085:26: note: Assignment 'node=malloc(sizeof(struct treeNode))', assigned value is 0 treeNode *node = malloc(sizeof(treeNode)); ^ SESANS_Delft.c:9086:3: note: Null pointer dereference node->depth = depth; ^ SESANS_Delft.c:9089:3: warning: If memory allocation fails, then there is a possible null pointer dereference: node [nullPointerOutOfMemory] node->point = points[med]; ^ SESANS_Delft.c:9085:26: note: Assuming allocation function fails treeNode *node = malloc(sizeof(treeNode)); ^ SESANS_Delft.c:9085:26: note: Assignment 'node=malloc(sizeof(struct treeNode))', assigned value is 0 treeNode *node = malloc(sizeof(treeNode)); ^ SESANS_Delft.c:9089:3: note: Null pointer dereference node->point = points[med]; ^ SESANS_Delft.c:9091:3: warning: If memory allocation fails, then there is a possible null pointer dereference: node [nullPointerOutOfMemory] node->lChild = kdtree_addToTree(points, left, med-1, depth + 1); ^ SESANS_Delft.c:9085:26: note: Assuming allocation function fails treeNode *node = malloc(sizeof(treeNode)); ^ SESANS_Delft.c:9085:26: note: Assignment 'node=malloc(sizeof(struct treeNode))', assigned value is 0 treeNode *node = malloc(sizeof(treeNode)); ^ SESANS_Delft.c:9091:3: note: Null pointer dereference node->lChild = kdtree_addToTree(points, left, med-1, depth + 1); ^ SESANS_Delft.c:9092:3: warning: If memory allocation fails, then there is a possible null pointer dereference: node [nullPointerOutOfMemory] node->rChild = kdtree_addToTree(points, med+1, right, depth + 1); ^ SESANS_Delft.c:9085:26: note: Assuming allocation function fails treeNode *node = malloc(sizeof(treeNode)); ^ SESANS_Delft.c:9085:26: note: Assignment 'node=malloc(sizeof(struct treeNode))', assigned value is 0 treeNode *node = malloc(sizeof(treeNode)); ^ SESANS_Delft.c:9092:3: note: Null pointer dereference node->rChild = kdtree_addToTree(points, med+1, right, depth + 1); ^ SESANS_Delft.c:9218:9: warning: If memory allocation fails, then there is a possible null pointer dereference: indices [nullPointerOutOfMemory] if (indices[i] < 0) indices[i]=0; ^ SESANS_Delft.c:9500:27: note: Assuming allocation function fails long *indices = malloc((int)interpolator->space_dimensionality*sizeof(double)); ^ SESANS_Delft.c:9500:27: note: Assignment 'indices=malloc((int)interpolator->space_dimensionality*sizeof(double))', assigned value is 0 long *indices = malloc((int)interpolator->space_dimensionality*sizeof(double)); ^ SESANS_Delft.c:9504:60: note: Calling function 'interpolator_offset', 3rd argument 'indices' value is 0 long index = interpolator_offset(3, interpolator->bin, indices); ^ SESANS_Delft.c:9218:9: note: Null pointer dereference if (indices[i] < 0) indices[i]=0; ^ SESANS_Delft.c:9219:9: warning: If memory allocation fails, then there is a possible null pointer dereference: indices [nullPointerOutOfMemory] if (indices[i] >= dimInfo[i]) indices[i]=dimInfo[i]-1; ^ SESANS_Delft.c:9500:27: note: Assuming allocation function fails long *indices = malloc((int)interpolator->space_dimensionality*sizeof(double)); ^ SESANS_Delft.c:9500:27: note: Assignment 'indices=malloc((int)interpolator->space_dimensionality*sizeof(double))', assigned value is 0 long *indices = malloc((int)interpolator->space_dimensionality*sizeof(double)); ^ SESANS_Delft.c:9504:60: note: Calling function 'interpolator_offset', 3rd argument 'indices' value is 0 long index = interpolator_offset(3, interpolator->bin, indices); ^ SESANS_Delft.c:9219:9: note: Null pointer dereference if (indices[i] >= dimInfo[i]) indices[i]=dimInfo[i]-1; ^ SESANS_Delft.c:9223:23: warning: If memory allocation fails, then there is a possible null pointer dereference: indices [nullPointerOutOfMemory] result = i == 0 ? indices[0] ^ SESANS_Delft.c:9500:27: note: Assuming allocation function fails long *indices = malloc((int)interpolator->space_dimensionality*sizeof(double)); ^ SESANS_Delft.c:9500:27: note: Assignment 'indices=malloc((int)interpolator->space_dimensionality*sizeof(double))', assigned value is 0 long *indices = malloc((int)interpolator->space_dimensionality*sizeof(double)); ^ SESANS_Delft.c:9504:60: note: Calling function 'interpolator_offset', 3rd argument 'indices' value is 0 long index = interpolator_offset(3, interpolator->bin, indices); ^ SESANS_Delft.c:9223:23: note: Null pointer dereference result = i == 0 ? indices[0] ^ SESANS_Delft.c:9224:45: warning: If memory allocation fails, then there is a possible null pointer dereference: indices [nullPointerOutOfMemory] : result * dimInfo[i] + indices[i]; ^ SESANS_Delft.c:9500:27: note: Assuming allocation function fails long *indices = malloc((int)interpolator->space_dimensionality*sizeof(double)); ^ SESANS_Delft.c:9500:27: note: Assignment 'indices=malloc((int)interpolator->space_dimensionality*sizeof(double))', assigned value is 0 long *indices = malloc((int)interpolator->space_dimensionality*sizeof(double)); ^ SESANS_Delft.c:9504:60: note: Calling function 'interpolator_offset', 3rd argument 'indices' value is 0 long index = interpolator_offset(3, interpolator->bin, indices); ^ SESANS_Delft.c:9224:45: note: Null pointer dereference : result * dimInfo[i] + indices[i]; ^ SESANS_Delft.c:9317:7: warning: If memory allocation fails, then there is a possible null pointer dereference: vector [nullPointerOutOfMemory] vector[index] = x; ^ SESANS_Delft.c:9309:38: note: Assuming allocation function fails double* vector = (double*) calloc(sizeof(double), table.rows); ^ SESANS_Delft.c:9309:22: note: Assignment 'vector=(double*)calloc(sizeof(double),table.rows)', assigned value is 0 double* vector = (double*) calloc(sizeof(double), table.rows); ^ SESANS_Delft.c:9317:7: note: Null pointer dereference vector[index] = x; ^ SESANS_Delft.c:9320:11: warning: If memory allocation fails, then there is a possible null pointer dereference: vector [nullPointerOutOfMemory] qsort(vector, table.rows, sizeof(double), interpolator_double_vector_compare); ^ SESANS_Delft.c:9309:38: note: Assuming allocation function fails double* vector = (double*) calloc(sizeof(double), table.rows); ^ SESANS_Delft.c:9309:22: note: Assignment 'vector=(double*)calloc(sizeof(double),table.rows)', assigned value is 0 double* vector = (double*) calloc(sizeof(double), table.rows); ^ SESANS_Delft.c:9320:11: note: Null pointer dereference qsort(vector, table.rows, sizeof(double), interpolator_double_vector_compare); ^ SESANS_Delft.c:9324:18: warning: If memory allocation fails, then there is a possible null pointer dereference: vector [nullPointerOutOfMemory] double x = vector[index]; ^ SESANS_Delft.c:9309:38: note: Assuming allocation function fails double* vector = (double*) calloc(sizeof(double), table.rows); ^ SESANS_Delft.c:9309:22: note: Assignment 'vector=(double*)calloc(sizeof(double),table.rows)', assigned value is 0 double* vector = (double*) calloc(sizeof(double), table.rows); ^ SESANS_Delft.c:9324:18: note: Null pointer dereference double x = vector[index]; ^ SESANS_Delft.c:9400:11: warning: If memory allocation fails, then there is a possible null pointer dereference: indices [nullPointerOutOfMemory] indices[axis] = round((x - interpolator->min[axis])/interpolator->step[axis]); ^ SESANS_Delft.c:9393:31: note: Assuming allocation function fails long *indices = malloc(interpolator->space_dimensionality*sizeof(long)); ^ SESANS_Delft.c:9393:31: note: Assignment 'indices=malloc(interpolator->space_dimensionality*sizeof(long))', assigned value is 0 long *indices = malloc(interpolator->space_dimensionality*sizeof(long)); ^ SESANS_Delft.c:9400:11: note: Null pointer dereference indices[axis] = round((x - interpolator->min[axis])/interpolator->step[axis]); ^ SESANS_Delft.c:9502:7: warning: If memory allocation fails, then there is a possible null pointer dereference: indices [nullPointerOutOfMemory] indices[axis] = round((space[axis]-interpolator->min[axis])/interpolator->step[axis]); ^ SESANS_Delft.c:9500:27: note: Assuming allocation function fails long *indices = malloc((int)interpolator->space_dimensionality*sizeof(double)); ^ SESANS_Delft.c:9500:27: note: Assignment 'indices=malloc((int)interpolator->space_dimensionality*sizeof(double))', assigned value is 0 long *indices = malloc((int)interpolator->space_dimensionality*sizeof(double)); ^ SESANS_Delft.c:9502:7: note: Null pointer dereference indices[axis] = round((space[axis]-interpolator->min[axis])/interpolator->step[axis]); ^ SESANS_Delft.c:9688:5: warning: If memory allocation fails, then there is a possible null pointer dereference: stack [nullPointerOutOfMemory] stack[i+1]=stack[i]; ^ SESANS_Delft.c:9680:31: note: Assuming allocation function fails _particle->mcMagnet=calloc(MCMAGNET_STACKSIZE,sizeof(mcmagnet_field_info *)); ^ SESANS_Delft.c:9680:31: note: Assignment '_particle->mcMagnet=calloc(12,sizeof(struct mcmagnet_field_info*))', assigned value is 0 _particle->mcMagnet=calloc(MCMAGNET_STACKSIZE,sizeof(mcmagnet_field_info *)); ^ SESANS_Delft.c:9683:30: note: stack is assigned '(struct mcmagnet_field_info**)_particle->mcMagnet' here. mcmagnet_field_info **stack=((mcmagnet_field_info **) _particle->mcMagnet); ^ SESANS_Delft.c:9688:5: note: Null pointer dereference stack[i+1]=stack[i]; ^ SESANS_Delft.c:9688:16: warning: If memory allocation fails, then there is a possible null pointer dereference: stack [nullPointerOutOfMemory] stack[i+1]=stack[i]; ^ SESANS_Delft.c:9680:31: note: Assuming allocation function fails _particle->mcMagnet=calloc(MCMAGNET_STACKSIZE,sizeof(mcmagnet_field_info *)); ^ SESANS_Delft.c:9680:31: note: Assignment '_particle->mcMagnet=calloc(12,sizeof(struct mcmagnet_field_info*))', assigned value is 0 _particle->mcMagnet=calloc(MCMAGNET_STACKSIZE,sizeof(mcmagnet_field_info *)); ^ SESANS_Delft.c:9683:30: note: stack is assigned '(struct mcmagnet_field_info**)_particle->mcMagnet' here. mcmagnet_field_info **stack=((mcmagnet_field_info **) _particle->mcMagnet); ^ SESANS_Delft.c:9688:16: note: Null pointer dereference stack[i+1]=stack[i]; ^ SESANS_Delft.c:9694:3: warning: If memory allocation fails, then there is a possible null pointer dereference: stack [nullPointerOutOfMemory] stack[0]=calloc(1, sizeof(mcmagnet_field_info)); ^ SESANS_Delft.c:9680:31: note: Assuming allocation function fails _particle->mcMagnet=calloc(MCMAGNET_STACKSIZE,sizeof(mcmagnet_field_info *)); ^ SESANS_Delft.c:9680:31: note: Assignment '_particle->mcMagnet=calloc(12,sizeof(struct mcmagnet_field_info*))', assigned value is 0 _particle->mcMagnet=calloc(MCMAGNET_STACKSIZE,sizeof(mcmagnet_field_info *)); ^ SESANS_Delft.c:9683:30: note: stack is assigned '(struct mcmagnet_field_info**)_particle->mcMagnet' here. mcmagnet_field_info **stack=((mcmagnet_field_info **) _particle->mcMagnet); ^ SESANS_Delft.c:9694:3: note: Null pointer dereference stack[0]=calloc(1, sizeof(mcmagnet_field_info)); ^ SESANS_Delft.c:9697:3: warning: If memory allocation fails, then there is a possible null pointer dereference: stack [nullPointerOutOfMemory] mcmagnet_pack(stack[0],func_id,magnet_rot,magnet_pos,stopbit,prms); ^ SESANS_Delft.c:9680:31: note: Assuming allocation function fails _particle->mcMagnet=calloc(MCMAGNET_STACKSIZE,sizeof(mcmagnet_field_info *)); ^ SESANS_Delft.c:9680:31: note: Assignment '_particle->mcMagnet=calloc(12,sizeof(struct mcmagnet_field_info*))', assigned value is 0 _particle->mcMagnet=calloc(MCMAGNET_STACKSIZE,sizeof(mcmagnet_field_info *)); ^ SESANS_Delft.c:9683:30: note: stack is assigned '(struct mcmagnet_field_info**)_particle->mcMagnet' here. mcmagnet_field_info **stack=((mcmagnet_field_info **) _particle->mcMagnet); ^ SESANS_Delft.c:9697:3: note: Null pointer dereference mcmagnet_pack(stack[0],func_id,magnet_rot,magnet_pos,stopbit,prms); ^ SESANS_Delft.c:9697:3: warning: If memory allocation fails, then there is a possible null pointer dereference: mctmp_p [nullPointerOutOfMemory] mcmagnet_pack(stack[0],func_id,magnet_rot,magnet_pos,stopbit,prms); ^ SESANS_Delft.c:9694:18: note: Assuming allocation function fails stack[0]=calloc(1, sizeof(mcmagnet_field_info)); ^ SESANS_Delft.c:9694:18: note: Assignment 'stack[0]=calloc(1,sizeof(struct mcmagnet_field_info))', assigned value is 0 stack[0]=calloc(1, sizeof(mcmagnet_field_info)); ^ SESANS_Delft.c:9697:3: note: mctmp_p is assigned 'stack[0]' here. mcmagnet_pack(stack[0],func_id,magnet_rot,magnet_pos,stopbit,prms); ^ SESANS_Delft.c:9697:3: note: Null pointer dereference mcmagnet_pack(stack[0],func_id,magnet_rot,magnet_pos,stopbit,prms); ^ SESANS_Delft.c:9226:10: warning: Uninitialized variable: result [uninitvar] return result; ^ SESANS_Delft.c:9222:15: note: Assuming condition is false for (i=0; i < dim; i++) { ^ SESANS_Delft.c:9226:10: note: Uninitialized variable: result return result; ^ SESANS_Delft.c:9224:23: error: Uninitialized variable: result [legacyUninitvar] : result * dimInfo[i] + indices[i]; ^ Checking SESANS_Delft.c: MCDEFAULT_NCOUNT=1000000;ND_BUFFER=10000000;SIGABRT=1;SIGBREAK=1;SIGBUS=1;SIGPE=1;SIGHUP=1;SIGILL=1;SIGINT=1;SIGKILL=1;SIGUSR1=1;SIGUSR2=1;SIGPIPE=1;SIGQUIT=1;SIGSEGV=1;SIGTRAP=1;SIGURG=1;SIGFPE=1;SIGKILL=1;SIGTERM=1;__unix__=1;SIGKILL;SIGUSR1;SIGUSR2... Checking SESANS_Delft.c: MCDEFAULT_NCOUNT=1000000;ND_BUFFER=10000000;SIGABRT=1;SIGBREAK=1;SIGBUS=1;SIGPE=1;SIGHUP=1;SIGILL=1;SIGINT=1;SIGKILL=1;SIGUSR1=1;SIGUSR2=1;SIGPIPE=1;SIGQUIT=1;SIGSEGV=1;SIGTRAP=1;SIGURG=1;SIGFPE=1;SIGKILL=1;SIGTERM=1;__unix__=1;USE_MPI... Checking SESANS_Delft.c: MCDEFAULT_NCOUNT=1000000;ND_BUFFER=10000000;SIGABRT=1;SIGBREAK=1;SIGBUS=1;SIGPE=1;SIGHUP=1;SIGILL=1;SIGINT=1;SIGKILL=1;SIGUSR1=1;SIGUSR2=1;SIGPIPE=1;SIGQUIT=1;SIGSEGV=1;SIGTRAP=1;SIGURG=1;SIGFPE=1;SIGKILL=1;SIGTERM=1;__unix__=1;USE_MPI;USE_NEXUS... Checking SESANS_Delft.c: MCDEFAULT_NCOUNT=1000000;ND_BUFFER=10000000;SIGABRT=1;SIGBREAK=1;SIGBUS=1;SIGPE=1;SIGHUP=1;SIGILL=1;SIGINT=1;SIGKILL=1;SIGUSR1=1;SIGUSR2=1;SIGPIPE=1;SIGQUIT=1;SIGSEGV=1;SIGTRAP=1;SIGURG=1;SIGFPE=1;SIGKILL=1;SIGTERM=1;__unix__=1;USE_NEXUS... Checking SESANS_Delft.c: MCDEFAULT_NCOUNT=1000000;ND_BUFFER=10000000;SIGABRT=1;SIGBREAK=1;SIGBUS=1;SIGPE=1;SIGHUP=1;SIGILL=1;SIGINT=1;SIGKILL=1;SIGUSR1=1;SIGUSR2=1;SIGPIPE=1;SIGQUIT=1;SIGSEGV=1;SIGTRAP=1;SIGURG=1;SIGFPE=1;SIGKILL=1;SIGTERM=1;__unix__=1;__APPLE__;__GNUC__... Checking SESANS_Delft.c: MCDEFAULT_NCOUNT=1000000;ND_BUFFER=10000000;SIGABRT=1;SIGBREAK=1;SIGBUS=1;SIGPE=1;SIGHUP=1;SIGILL=1;SIGINT=1;SIGKILL=1;SIGUSR1=1;SIGUSR2=1;SIGPIPE=1;SIGQUIT=1;SIGSEGV=1;SIGTRAP=1;SIGURG=1;SIGFPE=1;SIGKILL=1;SIGTERM=1;__unix__=1;__APPLE__;__unix__... Checking SESANS_Delft.c: MCDEFAULT_NCOUNT=1000000;ND_BUFFER=10000000;SIGABRT=1;SIGBREAK=1;SIGBUS=1;SIGPE=1;SIGHUP=1;SIGILL=1;SIGINT=1;SIGKILL=1;SIGUSR1=1;SIGUSR2=1;SIGPIPE=1;SIGQUIT=1;SIGSEGV=1;SIGTRAP=1;SIGURG=1;SIGFPE=1;SIGKILL=1;SIGTERM=1;__unix__=1;__FreeBSD__... Checking SESANS_Delft.c: MCDEFAULT_NCOUNT=1000000;ND_BUFFER=10000000;SIGABRT=1;SIGBREAK=1;SIGBUS=1;SIGPE=1;SIGHUP=1;SIGILL=1;SIGINT=1;SIGKILL=1;SIGUSR1=1;SIGUSR2=1;SIGPIPE=1;SIGQUIT=1;SIGSEGV=1;SIGTRAP=1;SIGURG=1;SIGFPE=1;SIGKILL=1;SIGTERM=1;__unix__=1;__GNUC__... Checking SESANS_Delft.c: MCDEFAULT_NCOUNT=1000000;ND_BUFFER=10000000;SIGABRT=1;SIGBREAK=1;SIGBUS=1;SIGPE=1;SIGHUP=1;SIGILL=1;SIGINT=1;SIGKILL=1;SIGUSR1=1;SIGUSR2=1;SIGPIPE=1;SIGQUIT=1;SIGSEGV=1;SIGTRAP=1;SIGURG=1;SIGFPE=1;SIGKILL=1;SIGTERM=1;__unix__=1;__GNUC__;__clang__... Checking SESANS_Delft.c: MCDEFAULT_NCOUNT=1000000;ND_BUFFER=10000000;SIGABRT=1;SIGBREAK=1;SIGBUS=1;SIGPE=1;SIGHUP=1;SIGILL=1;SIGINT=1;SIGKILL=1;SIGUSR1=1;SIGUSR2=1;SIGPIPE=1;SIGQUIT=1;SIGSEGV=1;SIGTRAP=1;SIGURG=1;SIGFPE=1;SIGKILL=1;SIGTERM=1;__unix__=1;__dest_os... DEBUG: CMD: cppcheck finished INFO: End of linting ./SESANS_Delft.c