Powered by Linux
uninitialized symbol 'xxxx' is too overzealous? — Semantic Matching Tool

uninitialized symbol 'xxxx' is too overzealous?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello!

   I just updated to the tip of master for smatch and it seems uninitialized variables detection is way too overzealous.
   While it did find one valid usage, I cannot stop imagining that it basically assumes that if you
   pass a pointer to uninitialized variable somewhere, the variable would remain unitialized at least sometimes.

   E.g. this code:
struct page *ll_get_dir_page(struct inode *dir, struct md_op_data *op_data,
                             __u64 offset, struct ll_dir_chain *chain)
{
        struct md_callback      cb_op;
        struct page             *page;
        int                     rc;

        cb_op.md_blocking_ast = ll_md_blocking_ast;
        rc = md_read_page(ll_i2mdexp(dir), op_data, &cb_op, offset, &page);
        if (rc != 0)
                return ERR_PTR(rc);

        return page;
}

   Produces:
lustre/llite/dir.c:156 ll_get_dir_page() error: uninitialized symbol 'page’.

   I went through everythign down the stack and I cannot see how.

   The actual code could be seen here:
https://git.hpdd.intel.com/?p=fs/lustre-release.git;a=blob;f=lustre/llite/dir.c;h=44b174726677b780f01c4bd252d599deb08ac083;hb=refs/heads/master

   Am I missing something? This is on by default even without —-spammy

   Also is —two-pass supposed to do anything worthwhile? So far the most visible effect is complaining
   how basically every function call return is “unused”.

   Thanks.

Bye,
    Oleg--
To unsubscribe from this list: send the line "unsubscribe smatch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux