[cfe-dev] How to fix null-deref-ps.c on FreeBSD?

Ted Kremenek kremenek at apple.com
Tue Feb 17 08:45:29 PST 2009


Hi Ben,

The analyzer knows that all functions with the 'noreturn' attribute  
don't return.  What does the assert macro expand to on FreeBSD?

On Feb 17, 2009, at 7:08 AM, Ben Laurie wrote:

> This test fails on FreeBSD, and the following patch fixes it:
>
> Index: test/Analysis/null-deref-ps.c
> ===================================================================
> --- test/Analysis/null-deref-ps.c       (revision 64762)
> +++ test/Analysis/null-deref-ps.c       (working copy)
> @@ -129,6 +129,8 @@
>
> int* qux();
>
> +void __assert(const char *, const char *, int, const char *)
> __attribute__((__noreturn__));
> +
> int f9(unsigned len) {
>   assert (len != 0);
>   int *p = 0;
>
> the problem being, of course, that the analyzer has to understand that
> a failed assert does not return...
>
> But how would I go about fixing this properly?
> _______________________________________________
> 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