warning: division by zero

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

 



In Linux kernel, we get that message 2 times (in x86_64 allmodconfig):

../fs/exofs/ore_raid.c:95:64: warning: division by zero
../fs/exofs/ore_raid.c:116:36: warning: division by zero

when dividing by variable sizeof_a1pa, where that is:
	const unsigned sizeof__a1pa = sizeof(_aab->__a1pa[0]);

which is in this struct:
	struct _alloc_all_bytes {
		struct __alloc_stripe_pages_2d {
			struct __stripe_pages_2d sp2d;
			struct __1_page_stripe _1p_stripes[pages_in_unit];
		} __asp2d;
		struct __alloc_1p_arrays {
			struct page *pages[group_width];
			struct page *scribble[group_width];
			char page_is_read[data_devs];
		} __a1pa[pages_in_unit];
	} *_aab;

where 'pages_in_unit' is a function parameter. So, yes, it could have a value
of zero.

Is the warning message considered correct or useful as is?  If so, OK, no problem.
Although I would rather see something more like:
	warning: variable length array on stack

thanks,
-- 
~Randy
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux