Type Cast Conversion

I am using pgcc with a GPU Tesla card to accelerate a program written in C.
I am decorating the C program with pragmas however I am unable to come up with a solution for the following error message:

PGC-W-0095-Type cast required for this conversion (static.c: 531)

#pragma acc routine(read_ref_seq)
528 void read_ref_seq(stats_t *stats, int32_t tid, int32_t pos)
529 {
530 int i, fai_ref_len;
531 char *fai_ref = *faidx_fetch_seq(stats->info->fai, stats->info->sam_header->target_name[tid], pos, pos+stats->mrseq_buf-1, &fai_ref_len);
532 if ( fai_ref_len<0 ) error(“Failed to fetch the sequence “%s”\n”, stats->info->sam_header->target_name[tid]);
533
534 uint8_t *ptr = stats->rseq_buf;
535 for (i=0; i<fai_ref_len; i++)
536 {
537 // Conversion between uint8_t coding and ACGT
538 // -12-4—8-------
539 // =ACMGRSVTWYHKDBN
540 switch (fai_ref[i])
541 {
542 case ‘A’:
543 case ‘a’: *ptr = 1; break;
544 case ‘C’:
545 case ‘c’: *ptr = 2; break;
546 case ‘G’:
547 case ‘g’: *ptr = 4; break;
548 case ‘T’:
549 case ‘t’: *ptr = 8; break;
550 default: *ptr = 0; break;
551 }
552 ptr++;
553 }
554 free(fai_ref);
555
556 if ( fai_ref_len < stats->mrseq_buf ) memset(ptr,0, stats->mrseq_buf - fai_ref_len);
557 stats->nrseq_buf = fai_ref_len;
558 stats->rseq_pos = pos;
559 stats->tid = tid;
560 }

I’m not sure anyone could give specific help without more information.

It looks like faidx_fetch_seq is a function call.

Is it a function call?

If so, what is the prototype for that function? What type does it return?

The use of the asterisk immediately before the function call looks very suspicious to me. Unless the function returns a pointer-to-pointer, your usage here cannot possibly be correct.