[Risolto]Definire variabili locali una sola volta

Si, solo che avevo capito che se dichiarata static poteva stare fuori dalla funzione, a patto che tutta la funzione fosse in un file separato dal programma principale.

Dal K&R seconda edizione, pag 83, static variables

Static storage is specified by prefixing the normal declaration with the word static. If the two routines and the two variables are compiled in one file, as in

static char buf[BUFSIZE]; /*buffer for ungetch*/
static int bufp = 0; /*next free position  in buf*/

int getch (void) { ...}  
void ungetch (int c) { ...}

then no other routine will be able to access buf and bufp, and those names will not conflict with the same names in other files of the same program.