File: endian.c

package info (click to toggle)
spim 6.1-3
  • links: PTS
  • area: non-free
  • in suites: hamm, slink
  • size: 1,944 kB
  • ctags: 2,839
  • sloc: asm: 10,339; ansic: 9,404; yacc: 1,867; makefile: 713; lex: 583; sh: 95
file content (8 lines) | stat: -rw-r--r-- 125 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
int
main ()
{
  int x = 0x12345678;

  /* Return 1 for little-endian, 0 for big-endian. */
  return (*(char *)&x == 0x78);
}