Jump to content
  • Revista PROGRAMAR: Já está disponível a edição #60 da revista programar. Faz já o download aqui!

nram

Erros invocando Splint

Recommended Posts

nram

Boas,

O que acontece é que ando a fazer um pequeno trabalho, e por curiosidade invoquei o SPLINT. Está a dar-me uns erros/warnings que não estou a ver como os corrigir, vou postar os erros, assim como as linhas:

redesocial.c: (in function hashTableInit)
redesocial.c:74:2: Function returns with null storage derivable from global
                      tabHash[]
  A possibly null pointer is reachable from a parameter or global variable that
  is not declared using a /*@null@*/ annotation. (Use -nullstate to inhibit
  warning)
   redesocial.c:71:16: Storage tabHash[] becomes null
redesocial.c:74:2: Function returns with null storage derivable from global
                      hashNomes[]
   redesocial.c:72:18: Storage hashNomes[] becomes null
redesocial.c:86:8: Parse Error. (For help on parse errors, see splint -help
                      parseerrors.)
*** Cannot continue.

Linhas: 74

void hashTableInit (void) {
int i;			
for(i=0;i<TAMHASH;i++){
	tabHash[i] = NULL;
	hashNomes[i] = NULL;
}
}  // Linha 74

Linha: 86

int inserirHashNome (ENT *ent, char nome[], int nif){
int indice;
indice = calculaIndiceNome(nome);	
ONOMES *xnome=hashNomes[indice]; //Linha 86
ONOMES *end;
end = (ONOMES *)malloc(sizeof(ONOMES));
if (xnome){
	end->next = xnome;
}else{
	end->next = NULL;
}
hashNomes[indice] = end;
strcpy( end->nome, nome);
end->ncont = nif;
end->sEnt = ent;
return 0;
}

cumprimentos

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.