Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 11.1 and NULL defined as ((void*) 0)
#1
Please consider the following test program:

Code:
#define NULL ((void*) 0)

struct super_block;
struct inode;

typedef int (*find_inode_t)(struct inode *, unsigned long, void *);


extern struct inode * iget4_locked(struct super_block *, unsigned long,
                   find_inode_t, void *);

static inline struct inode *iget(struct super_block *sb, unsigned long ino)
{
    struct inode *inode = iget4_locked(sb, ino, NULL, NULL);
    return inode;
}


My reading of rule 11.1 is that NULL (so defined, which is quite common) cannot be passed that way to iget4_locked(). However, since I see zillions of violations of this kind, I am caught by the doubt.
Many thanks,

Roberto
<t></t>
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)