Aggiunto programma di test per l'endianess
authorSimone Piccardi <piccardi@gnulinux.it>
Sun, 17 Aug 2003 12:20:44 +0000 (12:20 +0000)
committerSimone Piccardi <piccardi@gnulinux.it>
Sun, 17 Aug 2003 12:20:44 +0000 (12:20 +0000)
sources/Makefile
sources/endtest.c [new file with mode: 0644]

index 82ae8e4..1e4b12c 100644 (file)
@@ -88,8 +88,10 @@ ipctestid: IPCTestId.c
 writeshm: WriteShm.c
        $(CC) $(CFLAGJ) $^ -o $@
 
-#readshm: ReadShm.c
-#      $(CC) $(CFLAGJ) $^ -o $@
+endtest: endtest.c
+
+readshm: ReadShm.c
+       $(CC) $(CFLAGJ) $^ -o $@
 
 
 # Macro per la generazione della tarball dei sorgenti
diff --git a/sources/endtest.c b/sources/endtest.c
new file mode 100644 (file)
index 0000000..ffeca88
--- /dev/null
@@ -0,0 +1,13 @@
+#include<stdio.h>
+int main(int argc, char *argv[])
+{
+    int i, val = 0xABCDEF01;
+    char * ptr;
+
+    printf("Using value %X\n", val);
+    ptr = (char *) &val;
+    for (i=0; i<sizeof(int); i++) {
+       printf("val[%d]=%2hhX\n", i, ptr[i]);
+    }
+    return 0;
+}