#2106: Make ParseFile.c more robust -----------------------+---------------------------------------------------- Reporter: eschnett | Owner: Type: defect | Status: reopened Priority: unset | Milestone: Component: Cactus | Version: development version Resolution: | Keywords: -----------------------+----------------------------------------------------
Comment (by rhaas):
Yes, please. The "< 0" vs. "== -1" is the only thing missing. In line 347 {{{ if (*filesize < 0) }}} it it probably best to actually write {{{ if (*filesize == (unsigned long int)-1) }}} since in the current version an aggressively optimizing compiler might do the following steps: * filesize is declared to be {{{unsigned long *filesize}}} * unsigned values can never be negative * the if statement can never trigger * compiler removes the error check (though usually at least generating a warning)