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


Erros invocando Splint

Recommended Posts



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

Linhas: 74

void hashTableInit (void) {
int 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;
	end->next = NULL;
hashNomes[indice] = end;
strcpy( end->nome, nome);
end->ncont = nif;
end->sEnt = ent;
return 0;


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.