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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1347288296.2124.12.camel@twins>
Date:	Mon, 10 Sep 2012 16:44:56 +0200
From:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
To:	Irina Tirdea <irina.tirdea@...il.com>
Cc:	Pekka Enberg <penberg@...nel.org>, mingo@...hat.com,
	acme@...stprotocols.net, rostedt@...dmis.org, paulus@...ba.org,
	dsahern@...il.com, namhyung.kim@....com,
	linux-kernel@...r.kernel.org, Irina Tirdea <irina.tirdea@...el.com>
Subject: Re: [PATCH v2 03/12] perf tools: include __WORDSIZE definition

On Sun, 2012-09-09 at 01:19 +0300, Irina Tirdea wrote:
> >> +#ifndef __WORDSIZE
> >> +#if defined(__x86_64__)
> >> +# define __WORDSIZE 64
> >> +#endif
> >> +#if defined(__i386__) || defined(__arm__)
> >> +# define __WORDSIZE 32
> >> +#endif
> >> +#endif
> >
> > Why not use "sizeof(unsigned long) * 8" ?
> 
> I tried to do it this, but the compilation crashes because this value
> is tested in an #if:
> 
> target  C: libperf <= tools/perf/util/annotate.c
> In file included from tools/perf/util/include/linux/bitmap.h:5:0,
>                  from tools/perf/util/header.h:10,
>                  from tools/perf/util/session.h:6,
>                  from tools/perf/util/build-id.h:4,
>                  from tools/perf/util/annotate.c:11:
> tools/perf/util/include/linux/bitops.h: In function '__ffs':
> tools/perf/util/include/linux/bitops.h:62:5: warning: "sizeof" is not
> defined [-Wundef]
> tools/perf/util/include/linux/bitops.h:62:5: error: missing binary
> operator before token "("

Use either: __SIZEOF_LONG__ (8) or __LP64__ (1) 
--
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