%% process.tex
%%
-%% Copyright (C) 2000-2012 Simone Piccardi. Permission is granted to
+%% Copyright (C) 2000-2013 Simone Piccardi. Permission is granted to
%% copy, distribute and/or modify this document under the terms of the GNU Free
%% Documentation License, Version 1.1 or any later version published by the
%% Free Software Foundation; with the Invariant Sections being "Un preambolo",
% TODO opzioni in formato esteso
+% TODO trattare il vettore ausiliario e getauxval (vedi
+% http://lwn.net/Articles/519085/)
+
+
\section{Problematiche di programmazione generica}
\label{sec:proc_gen_prog}
Il codice di detto programma, \file{endtest.c}, è nei sorgenti allegati,
allora se lo eseguiamo su un normale PC compatibile, che è \textit{little
endian} otterremo qualcosa del tipo:
-\begin{Command}
-[piccardi@gont sources]$ ./endtest
-\end{Command}
-%$
-\begin{Terminal}
+\begin{Console}
+[piccardi@gont sources]$ \textbf{./endtest}
Using value ABCDEF01
val[0]= 1
val[1]=EF
val[2]=CD
val[3]=AB
-\end{Terminal}
+\end{Console}
+%$
mentre su un vecchio Macintosh con PowerPC, che è \textit{big endian} avremo
qualcosa del tipo:
-\begin{Command}
-piccardi@anarres:~/gapil/sources$ ./endtest
-\end{Command}
-%$
-\begin{Terminal}
+\begin{Console}
+piccardi@anarres:~/gapil/sources$ \textbf{./endtest}
Using value ABCDEF01
val[0]=AB
val[1]=CD
val[2]=EF
val[3]= 1
-\end{Terminal}
+\end{Console}
+%$
L'attenzione alla \textit{endianness} nella programmazione è importante, perché
se si fanno assunzioni relative alla propria architettura non è detto che