Originariamente inviato da Who am I
Un warning te lo da per questo:

codice:
else if((x+v)->posti_disponibili=0)(printf("\nNumero posti disponibili esaurito"));
Perché hai usato = invece di ==.
Un altro perché nella locate non ritorni nessun valore quando deve ritornare una variabile di tipo position.
Per quanto riguarda il segmentation fault è perché non hai inizializzato v nel main, e può contenere qualsiasi valore.
Correggi questi errori e vedi se hai ancora problemi.
ho eseguito quello che mi hai detto sopra, tranne nella locate perchè non ho capito bene cosa devo fare. cmq sembra funzionare, ma se per esempio provo a fare la prenotazione più volte di un volo si blocca.
ecco qui il codice
codice:
/*COMPITO 10 SETTEMBRE 2012*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define FLUSH while(getchar()!='\n')

/*****tipobaseList*******/
#define STR 20
typedef struct{
        char cognome[STR], nome[STR];
}tipobaseList;

int Confronta(tipobaseList a, tipobaseList b){
    if(!strcmp(a.cognome,b.cognome)) 
         return(strcmp(a.nome, b.nome));
    else return(strcmp(a.cognome, b.cognome));     
}

void LeggiStringa(char s[],unsigned long dim){
     unsigned long i=0;
     for (i=0; i<dim-1; i++)
     if ((s[i]=getchar())=='\n') break;
     if (i==dim-1) while (getchar()!='\n');
     s[i]='\0';
}

void LeggiElemento(tipobaseList *x){
     printf("\nInserisci cognome:");
     LeggiStringa(x->cognome,STR);
     printf("\nInserici nome:");
     LeggiStringa(x->nome,STR);
}


/********list*************/
#define LISTAVUOTA NULL

typedef struct nodoList{
       tipobaseList info;
       struct nodoList *next;
} *list;

typedef short boolean;
typedef list position;

void MakeNullList(list *l){
     *l=LISTAVUOTA;
}

boolean EmptyList(list l){
        return(l==LISTAVUOTA);
}

boolean  FullList(list l){
       return(0);
}

position End(list l){
        if(l==LISTAVUOTA) return(LISTAVUOTA);
        while(l->next!=LISTAVUOTA)
              l=l->next;
        return(l);
}

position First(list l){
         return(LISTAVUOTA);
}

void InsertList(list *l, position p,tipobaseList x){
     struct nodoList *tmp;
     if(!FullList(*l)){
                   tmp=(struct nodoList *) malloc(sizeof(struct nodoList));
                   tmp->info=x;
                   if(p==LISTAVUOTA){
                                     tmp->next=*l;
                                     *l=tmp;
                   }else{
                         tmp->next=p->next;
                         p->next=tmp;
                   }
     }
}

void DeleteList(list *l, position p){
     struct nodoList *tmp;
     if(p==LISTAVUOTA){
                       tmp=(*l)->next;
                       free(*l);
                       *l=tmp;
     }else {
           tmp=p->next;
           p->next=tmp->next;
           free(tmp);
     }
}

position Next(list l, position p){
         if(p==LISTAVUOTA) return(l);
         else return(p->next);
}

tipobaseList Retrieve(list l, position p){
             if(l==LISTAVUOTA) return(l->info);
             else return(l->next->info);
}

position Locate(list l, tipobaseList x){
         if(!EmptyList(l)){
                if(!Confronta(l->info,x)) return(LISTAVUOTA);
                while(l->next!=LISTAVUOTA){
                       if(!Confronta(l->next->info,x)) return(l);
                       l=l->next;                    
                } 
                return(l);           
         }
}

/*****archivio*******/
typedef struct{
        unsigned int posti_disponibili;
        list posti_acquistati;
        list posti_prenotati;
}archivio;
archivio *archivio_voli;


void AllocaVettore(archivio **, unsigned int );
void InizializzaVettore(archivio *, unsigned int);
void Insord(list *,tipobaseList);
void InserimentoPrenotazione(list *, tipobaseList);
void InserimentoAcquisto(list *, tipobaseList);
void Inserisci(archivio *, tipobaseList, unsigned int);



main (){
     unsigned int n,v=0, scelta;
     tipobaseList persona;
     
      do{
        printf("\n/**********ARCHIVIO VOLI***************/");
        printf("\n1-Alloca Vettore");
        printf("\n2-Numero posti disponibili");
        printf("\n3-Inserimento");
        printf("\n4-Conferma acquisto");
        printf("\n5-Esci");
        printf("\nscelta--------------->");
        scanf("%u", &scelta);
        FLUSH;
        switch(scelta){
                   case 1: do{
                              printf("\nInserisci il numero di elementi del vettore: ");
                              scanf("%u",&n);
                              FLUSH;
                           }while(n<2); 
                           AllocaVettore(&archivio_voli, n);
                           break;
                   case 2: InizializzaVettore(archivio_voli, n);
                           break;
                   case 3: LeggiElemento(&persona);
                           Inserisci(&archivio_voli[v], persona, n);
                           break;
                   case 4: LeggiElemento(&persona);
        }
      }while(scelta<4);
}



void AllocaVettore(archivio **x, unsigned int n){
     *x=(archivio *)malloc(n*sizeof(archivio));
}

void InizializzaVettore(archivio *x, unsigned int n){
     unsigned int i=0, s=0;
     for(i=0; i<n; i++){
        printf("\nNumero posti disponibili del volo <%u> ? ", i);
        scanf("%u", &s);
        FLUSH;
        (x+i)->posti_disponibili=s;
        MakeNullList(&((x+i)->posti_acquistati));
        MakeNullList(&((x+i)->posti_prenotati));
     }
}

void Insord(list *l,tipobaseList x){
     position p,u;
     tipobaseList tmp;
     if(EmptyList(*l))
           InsertList(l,First(*l),x);
     else {
          p=First(*l);
          u=End(*l);
          while(p!=u) {
                      tmp=Retrieve(*l,p);
                      if(Confronta(tmp,x)<0) p=Next(*l,p);
                      else break;
          }
          InsertList(l,p,x);
     }
}

void InserimentoPrenotazione(list *l,tipobaseList a){
     position p;
     if(!EmptyList(*l)) p=Locate(*l,a);
     if(!EmptyList(*l) && p!=End(*l))
                         printf("\nPasseggero gia' presente");
     else Insord(l,a);
}

void InserimentoAcquisto(list *l,tipobaseList a){
     position p;
     if(!EmptyList(*l)) p=Locate(*l,a);
     if(!EmptyList(*l) && p!=End(*l))
                       printf("\nPasseggero gia' presente");
     else Insord(l,a);
}
void Inserisci(archivio *x, tipobaseList a, unsigned int n){
     unsigned int v, c=0;
     do{
        printf("\nInserire codice volo: ");
        scanf("%u", &v);
        FLUSH;
        if(v>n) printf("\nCodice volo errato, riprova\n");
     }while(v>n) ;
     printf("\nposti disponibili %u\n", (x+v)->posti_disponibili);
     if((x+v)->posti_disponibili>0){
                         printf("\n1-prenota   ");
                         printf("2-acquista  ----->");
                         scanf("%u", &c);
                         FLUSH;
                         if(c==1){ 
                                InserimentoPrenotazione(&((x+v)->posti_prenotati), a);
                                printf("\nPrenotazione effettuata    ");
                         }                         
                         if(c==2){ 
                                   InserimentoAcquisto(&((x+v)->posti_acquistati), a);
                                   printf("\nAcquisto effettuato    ");
                         }
                         ((x+v)->posti_disponibili)--;
                         printf("posti disponibili rimasti %u\n",(x+v)->posti_disponibili);
     }else if((x+v)->posti_disponibili==0)(printf("\nNumero posti disponibili esaurito\n"));
}