Re: [PATCH] lscpu: Add byte order and bogoMIPS information

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

 



On Tue, Aug 17, 2010 at 08:49:50AM -0400, Mike Frysinger wrote:
> On Tue, Aug 17, 2010 at 8:41 AM, Davidlohr Bueso wrote:
> > +static
> > +int get_byteorder(void)
> > +{
> > +       int x = 1;
> > +       if (*(char *)&x == LENDIAN)
> > +               return LENDIAN;
> > +       else return BENDIAN;
> > +}
> 
> this looks like aliasing violations.  since util-linux is autotooled,
> use AC_C_BIGENDIAN and then WORDS_BIGENDIAN (assuming util-linux
> doesnt already provide something).

 $ grep ENDIAN ./configure.ac
 AC_C_BIGENDIAN

 or include bitops.h and use #if (__BYTE_ORDER == __BIG_ENDIAN) or so.

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux