lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 14 Aug 2015 10:29:04 +0200
From:	Johannes Berg <johannes@...solutions.net>
To:	linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
	linux-kernel <linux-kernel@...r.kernel.org>
Subject: GCOV_PROFILE_ALL breaks BUILD_BUG_ON(!is_power_of_2(8))

+linux-kernel

> +#define DECLARE_EWMA(name, _factor, _weight)> 	> 	> 	> 	> \
> +> 	> struct ewma_##name {> 	> 	> 	> 	> 	> 	> \
> +> 	> 	> unsigned long internal;> 	> 	> 	> 	> 	> \
> +> 	> };> 	> 	> 	> 	> 	> 	> 	> 	> \
> +> 	> static inline void ewma_##name##_init(struct ewma_##name *e)> 	> \
> +> 	> {> 	> 	> 	> 	> 	> 	> 	> 	> \
> +> 	> 	> BUILD_BUG_ON(!__builtin_constant_p(_factor));> 	> 	> \
> +> 	> 	> BUILD_BUG_ON(!__builtin_constant_p(_weight));> 	> 	> \
> +> 	> 	> BUILD_BUG_ON(!is_power_of_2(_factor));> 	> 	> 	> \
> +> 	> 	> BUILD_BUG_ON(!is_power_of_2(_weight));> 	> 	> 	> \
> 

So this seemed fine to me, but for some reason the compiler is saying
the BUILD_BUG_ON(!is_power_of_2(x)) fails, if and only if (!)
CONFIG_GCOV_PROFILE_ALL is enabled, which seems to boil down to the
compiler option -fprofile-arcs.

I'm going to replace this with just the code itself, i.e.

                /* both must be a power of 2 */
                BUILD_BUG_ON(_factor & (_factor - 1));
                BUILD_BUG_ON(_weight & (_weight - 1));

but should I have expected this?

johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ