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: <1385130172.1747.28.camel@leonhard>
Date:	Fri, 22 Nov 2013 23:22:52 +0900
From:	Namhyung Kim <namhyung@...nel.org>
To:	Jiri Olsa <jolsa@...hat.com>
Cc:	linux-kernel@...r.kernel.org,
	Corey Ashford <cjashfor@...ux.vnet.ibm.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Ingo Molnar <mingo@...e.hu>, Paul Mackerras <paulus@...ba.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Arnaldo Carvalho de Melo <acme@...hat.com>,
	Steven Rostedt <rostedt@...dmis.org>,
	David Ahern <dsahern@...il.com>
Subject: Re: [PATCH 03/22] tools lib traceevent: Add
 traceevent_host_bigendian function

2013-11-21 (목), 12:01 +0100, Jiri Olsa:
> Adding traceevent_host_bigendian function to get host
> endianity. It's used in following patches.

[SNIP]
> +static inline int traceevent_host_bigendian(void)
> +{
> +	unsigned char str[] = { 0x1, 0x2, 0x3, 0x4 };
> +	unsigned int *ptr;
> +
> +	ptr = (unsigned int *)str;
> +	return *ptr == 0x01020304;

Is it safe for every architecture supported - especially ones that
require stricter alignment?  I know many architectures/compilers align
stack but not sure doing this is safe for all architecture.

Thanks,
Namhyung


--
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