Issue while compiling Pro C files during 12C migration

During migration from 6i to e12c i am getting stuck with
Issue - while compiling Pro C files during 12C migration

-I/usr/include -I/opt/Oracle/Middlewar e/Oracle_Home/precomp/public -I/opt/Oracle/Middleware/Oracle_Home/xdk/include -I /opt/Oracle/Middleware/Oracle_Home/lib -I/opt/Oracle/Middleware/Oracle_Home/lib -I/usr/lib/gcc/x86_64-redhat-linux/4.8.2/include/ -c DFR010.c

DFR010.c: In function ‘select_records’:

DFR010.c:2269:6: warning: passing argument 1 of ‘fprintf’ from incompatible pointer type [enabled by default]

fprintf(fp2," %-6s %-8s%-12s %-40s %14.2lf %d",ws_vendorno.arr, ws_voucherno.arr, ws_voucherdate.arr, ws_name.arr,ws_mamount1, ws_actno);

^

In file included from DFR010.c:188:0:

/usr/include/stdio.h:356:12: note: expected ‘struct FILE * __restrict__’ but argument is of type ‘char *’extern int fprintf (FILE *__restrict __stream,

^

DFR010.c:2271:6: warning: passing argument 1 of ‘fprintf’ from incompatible pointer type [enabled by default]

fprintf(fp2, "\n");

^

In file included from DFR010.c:188:0:

/usr/include/stdio.h:356:12: note: expected ‘struct FILE * __restrict__’ but argument is of type ‘char *’

extern int fprintf (FILE *__restrict __stream,

^

DFR010.c:2334:1: warning: passing argument 1 of ‘fprintf’ from incompatible pointer type [enabled by default] fprintf(fp2,"\n --------- --------------------------------");

^

In file included from DFR010.c:188:0:

/usr/include/stdio.h:356:12: note: expected ‘struct FILE * __restrict__’ but argument is of type ‘char *’

extern int fprintf (FILE *__restrict __stream,

^

DFR010.c:2335:1: warning: passing argument 1 of ‘fprintf’ from incompatible pointer type [enabled by default] fprintf(fp2, "\n TOTAL: %14.2lf" ,ws_mamount1);

^

In file included from DFR010.c:188:0:

/usr/include/stdio.h:356:12: note: expected ‘struct FILE * __restrict__’ but argument is of type ‘char *’ extern int fprintf (FILE *__restrict __stream,

^

DFR010.c:2336:1: warning: passing argument 1 of ‘fprintf’ from incompatible pointer type [enabled by default]

fprintf(fp2,"\n --------- --------------------------------");

^

In file included from DFR010.c:188:0:

/usr/include/stdio.h:356:12: note: expected ‘struct FILE * __restrict__’ but argument is of type ‘char *’

extern int fprintf (FILE *__restrict __stream,

^

DFR010.c: In function ‘headprint’:

DFR010.c:2351:5: warning: passing argument 1 of ‘fprintf’ from incompatible pointer type [enabled by default]

fprintf(fp2,"\014");

^

In file included from DFR010.c:188:0:

/usr/include/stdio.h:356:12: note: expected ‘struct FILE * __restrict__’ but argument is of type ‘char *’ extern int fprintf (FILE *__restrict __stream,

^

DFR010.c:2353:2: warning: passing argument 1 of ‘fprintf’ from incompatible pointer type [enabled by default]

fprintf(fp2,"%\n %-50s Page :%d", mva_di vision.arr,pagecnt);

^

In file included from DFR010.c:188:0:

/usr/include/stdio.h:356:12: note: expected ‘struct FILE * __restrict__’ but argument is of type ‘char *’

extern int fprintf (FILE *__restrict __stream,

^

DFR010.c:2355:17: warning: passing argument 1 of ‘fprintf’ from incompatible pointer type [enabled by default]

trlbal_from.arr,trlbal_to.arr,mva_date.arr);

^

In file included from DFR010.c:188:0:

/usr/include/stdio.h:356:12: note: expected ‘struct FILE * __restrict__’ but argument is of type ‘char *’ extern int fprintf (FILE *__restrict __stream,

^

DFR010.c:2357:24: warning: passing argument 1 of ‘fprintf’ from incompatible pointer type [enabled by default]

ws_mamount);

^

In file included from DFR010.c:188:0:

/usr/include/stdio.h:356:12: note: expected ‘struct FILE * __restrict__’ but argument is of type ‘char *’

extern int fprintf (FILE *__restrict __stream,

^

DFR010.c:2361:2: warning: passing argument 1 of ‘fprintf’ from incompatible pointer type [enabled by default]

fprintf(fp2,"\n %d - FOR %-70s " ,ws_bankact ,w s_bankdesc.arr);

^

In file included from DFR010.c:188:0:

/usr/include/stdio.h:356:12: note: expected ‘struct FILE * __restrict__’ but argument is of type ‘char *’

extern int fprintf (FILE *__restrict __stream,

^

DFR010.c:2366:2: warning: passing argument 1 of ‘fprintf’ from incompatible pointer type [enabled by default]

fprintf(fp2,"\n %d - FOR %-70s" ,ws_accountno, ws_accoun tdesc.arr);

^

In file included from DFR010.c:188:0:

/usr/include/stdio.h:356:12: note: expected ‘struct FILE * __restrict__’ but argument is of type ‘char *’extern int fprintf (FILE *__restrict __stream,

^

DFR010.c:2369:2: warning: passing argument 1 of ‘fprintf’ from incompatible pointer type [enabled by default]

fprintf(fp2,"\n--------------------------------------------------------------- ---------------------------------");

^

In file included from DFR010.c:188:0:

/usr/include/stdio.h:356:12: note: expected ‘struct FILE * __restrict__’ but argument is of type ‘char *’

extern int fprintf (FILE *__restrict __stream,

^

DFR010.c:2370:2: warning: passing argument 1 of ‘fprintf’ from incompatible pointer type [enabled by default]

fprintf(fp2,"\n V CODE VR NO DATE VENDOR NAME AMOUNT CROSS A/C");

^

In file included from DFR010.c:188:0:

/usr/include/stdio.h:356:12: note: expected ‘struct FILE * __restrict__’ but argument is of type ‘char *’

extern int fprintf (FILE *__restrict __stream,

^

DFR010.c:2371:2: warning: passing argument 1 of ‘fprintf’ from incompatible pointer type [enabled by default]

fprintf(fp2,"\n--------------------------------------------------------------- ---------------------------------\n");

^

In file included from DFR010.c:188:0:

/usr/include/stdio.h:356:12: note: expected ‘struct FILE * __restrict__’ but argument is of type ‘char *’

extern int fprintf (FILE *__restrict __stream,
 


JasKinasis

Well-Known Member
Credits
4,041
Ok.
First up, please can you clearly explain what you’re trying to do? because your post isn’t very clear at all.

What is 6i and e12c??
Exactly what are you trying to compile?
Have you edited any of these source files? Or are you just trying to build them after downloading them from somewhere?

This isn’t the psychic hotline. We don’t magically know what you’re trying to do. We have very little information about what you’re doing, other than you are having problems compiling something Oracle/Red Hat related.

If you could give us a little more context and background on this, we’ll be able to help you out a lot more.
 
Hi, JasKinasis, thanks lot for your reply.
Regret for the half info.
Basically,
We are using Oracle based application which is on platform F&R 6i & DB 10g. (during this stage we have developed some reports using Pro C language).
Now we are migrating from F&R 6i to 12c & DB 10g to 12c.
during this migration while migrating Pro C related reports we are encountering this problem.
Hence was seeking some advice on the same.
 

JasKinasis

Well-Known Member
Credits
4,041
OK, so I've still had to look up what 6i, 10g and 12c are.
So you're upgrading to use a newer version of Oracle's database.
This application you're building - is this something that your company/employers have developed? or is it something you've downloaded and are trying to build?

Also which compiler and version are you using to build this? Is it gcc? or are you using the Pro C compiler? Also, which compiler and version was used to build the last known "good" version of this application?

Ignoring all of those questions and looking solely at the errors - the errors you're getting are complaining about an incompatible pointer type being used with various C standard library functions.
And many seem to refer to a variable called fp2. What is the definition of the fp2 variable? What is that variables type? Perhaps it's type is incorrect?!

For example - Where fp2 is being passed to fprintf - the fprintf function is expecting a FILE* - a pointer to a FILE object. So fp2 should be defined as a FILE* - if it is defined as FILE, or anything else - that could potentially cause this error.

So if fp2 is defined as FILE - you either need to change it's type to FILE*:
e.g.
C:
FILE* fp2 = fopen("/path/to/file", w);
OR if you leave it as FILE - then when you call fprintf - you should pass fp2 by reference instead of by value:
e.g.
C:
fprintf(&fp2, "Some string being written to the file!\n");
Failing that - is there any possibility that Pro C defines something different for FILE and FILE* - something that is incompatible with the C std library's definitions of FILE and FILE*?

Failing that - as this is Oracle related - and your company/employers are Oracle customers, it might be best to contact Oracle for support with this.

============================================
Edit:
============================================
A quick bit of duckduckgo-fu on the error message yielded this - which seems to back up my hunch that fp2 is probably declared as the wrong type:
============================================
 
Last edited:


Members online

No members online now.

Latest posts

Top