[cfe-dev] Opinion on Analyzer false positive

Anna Zaks ganna at apple.com
Wed Oct 24 17:16:13 PDT 2012


Erik,

I do not fully understand why you are getting the"garbage value" error message here. Looks like "flags.import" is getting initialized... Can you send the preprocessed file?

Thanks,
Anna.
On Oct 24, 2012, at 1:31 PM, Erik Cederstrand <erik at cederstrand.dk> wrote:

> Hi guys,
> 
> The Static Analyzer spits out this report on some ZFS code http://scan.freebsd.your.org/freebsd-head/WORLD/2012-10-24-amd64/report-uH6BjZ.html#EndPath
> 
> The code is OK in my opinion because the default return value for getopt(3) is '?': http://www.unix.com/man-page/posix/3posix/getopt/
> 
> I could change the '?' case to 'default:' but this is a pretty common pattern (plus, it's not our own code). Is it possible to create a special case for getopt() in the Analyzer? It would require splitting the input string to getopt() to restrict the possible return values of getopt().
> 
> Thanks,
> Erik
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list