INFO: No output directory specified (--dir) INFO: Using directory: "SNS_ARCS_20250814_120112" INFO: Regenerating c-file: SNS_ARCS.c DEBUG: CMD: /home/willend/micromamba/bin/mcstas -t -o ./SNS_ARCS.c SNS_ARCS.instr Info: 'SNS_source' is a contributed component. Info: 'Vertical_T0a' is a contributed component. Info: 'Fermi_chop2a' is a contributed component. Info: 'Spot_sample' 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: ./SNS_ARCS.c DEBUG: CMD: cppcheck ./SNS_ARCS.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 SNS_ARCS.c ... Checking SNS_ARCS.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... SNS_ARCS.c:7039:18: warning: If memory allocation fails, then there is a possible null pointer dereference: line [nullPointerOutOfMemory] while((fgets(line,Maxlength,fp)!=NULL)&&(strchr(line,'#')!=NULL)){ ^ SNS_ARCS.c:7031:16: note: Assuming allocation function fails line=malloc(200*sizeof(char)); ^ SNS_ARCS.c:7031:16: note: Assignment 'line=malloc(200*sizeof(char))', assigned value is 0 line=malloc(200*sizeof(char)); ^ SNS_ARCS.c:7035:11: note: Assuming condition is false if (fp==NULL){ ^ SNS_ARCS.c:7039:18: note: Null pointer dereference while((fgets(line,Maxlength,fp)!=NULL)&&(strchr(line,'#')!=NULL)){ ^ SNS_ARCS.c:16368:5: warning: If memory allocation fails, then there is a possible null pointer dereference: Imat [nullPointerOutOfMemory] Imat[idx1]=malloc(500*sizeof(double)); ^ SNS_ARCS.c:16366:14: note: Assuming allocation function fails Imat=malloc(200*sizeof(double*)); ^ SNS_ARCS.c:16366:14: note: Assignment 'Imat=malloc(200*sizeof(double*))', assigned value is 0 Imat=malloc(200*sizeof(double*)); ^ SNS_ARCS.c:16368:5: note: Null pointer dereference Imat[idx1]=malloc(500*sizeof(double)); ^ SNS_ARCS.c:16384:12: warning: If memory allocation fails, then there is a possible null pointer dereference: Imat [nullPointerOutOfMemory] tyval[0]=Imat[0][0]; ^ SNS_ARCS.c:16366:14: note: Assuming allocation function fails Imat=malloc(200*sizeof(double*)); ^ SNS_ARCS.c:16366:14: note: Assignment 'Imat=malloc(200*sizeof(double*))', assigned value is 0 Imat=malloc(200*sizeof(double*)); ^ SNS_ARCS.c:16384:12: note: Null pointer dereference tyval[0]=Imat[0][0]; ^ SNS_ARCS.c:16390:21: warning: If memory allocation fails, then there is a possible null pointer dereference: Imat [nullPointerOutOfMemory] tyval[idx2]=Imat[idx2][idx1]; ^ SNS_ARCS.c:16366:14: note: Assuming allocation function fails Imat=malloc(200*sizeof(double*)); ^ SNS_ARCS.c:16366:14: note: Assignment 'Imat=malloc(200*sizeof(double*))', assigned value is 0 Imat=malloc(200*sizeof(double*)); ^ SNS_ARCS.c:16390:21: note: Null pointer dereference tyval[idx2]=Imat[idx2][idx1]; ^ SNS_ARCS.c:16406:10: warning: If memory allocation fails, then there is a possible null pointer dereference: Imat [nullPointerOutOfMemory] free(Imat[idx1]); ^ SNS_ARCS.c:16366:14: note: Assuming allocation function fails Imat=malloc(200*sizeof(double*)); ^ SNS_ARCS.c:16366:14: note: Assignment 'Imat=malloc(200*sizeof(double*))', assigned value is 0 Imat=malloc(200*sizeof(double*)); ^ SNS_ARCS.c:16406:10: note: Null pointer dereference free(Imat[idx1]); ^ SNS_ARCS.c:7110:12: warning: Uninitialized variable: idx3max [uninitvar] *ntvals=idx3max+1;*nEvals=idx2; ^ SNS_ARCS.c:7094:15: note: Assuming condition is false while(idx1