int ar_open(FILE **f, const char * path)
{
char buf[8];
int count;
/* open the file */
if ((*f = (FILE*)fopen(path, "r"))==NULL) {
ar_error("error: cannot open file");
return E_AR_OPEN;
}
/* header */
read(*f, &buf, 8); // warning: passing arg 1 of `read' makes integer from pointer without a cast
skusal som priblizne tieto varianty prveho argumentu: f,*f,**f,***f,(FILE*)f,(FILE**)f,(FILE***)f,(FILE*)*f,... mozno som nieco zabudol, kompilujem s -Wall -pedantic

int ar_open(FILE *f, const char * path) { char buf[8]; int count; /* open the file */ if ((f = fopen(path, "r"))==NULL) { ar_error("error: cannot open file"); return E_AR_OPEN; } /* header */ if(fread(buf, 1, 8, f)!=8){ ar_error("error: subor neobsahuje ani 8 znakov, alebo nieco v tom zmysle ako chybova hlaska"); return E_AR_NEJAKACHYBA; } ...Opravena funkcia:
int ar_open(FILE **f, const char * path) { char buf[8]; /* int count; */ /* open the file */ if ((*f = fopen(path, "r"))==NULL) { ar_error("error: cannot open file"); printf("path=%s\n",path); return E_AR_OPEN; } /* header */ if(fread(buf, 1, 8, *f)!=8) { ar_error("error: invalid archive header"); return E_AR_HEADER; } return E_AR_OK; }FILE *f; f = ar_open("subor.a"); ar_read(f);