Operating System - Linux
1828354 Members
2982 Online
109976 Solutions
New Discussion

Re: ANSI feature support on compiler

 
SOLVED
Go to solution
skt_skt
Honored Contributor

ANSI feature support on compiler

K580/B.10.20. Not patched for more than an year.

hostname as oracle -> cc hide.c -o hide
cc: "hide.c", line 22: error 1705: Function prototypes are an ANSI feature.
cc: "hide.c", line 25: error 1705: Function prototypes are an ANSI feature.
cc: "hide.c", line 164: error 1705: Function prototypes are an ANSI feature.


#what /usr/bin/cc
/usr/bin/cc:
LINT A.10.32.03 CXREF A.10.32.03
HP92453-01 A.10.32.03 HP C Compiler
/usr/lib/libc: $Revision: 76.3 $

#grep -i Compiler swlist.product.07162007
C-ANSI-C B.10.20.00 HP C/ANSI C Compiler
COBOLCRT B.11.30 COBOL Compiler

any way i can enable the ANSI feature? or any third party compiler which works on 10.20?
8 REPLIES 8
James R. Ferguson
Acclaimed Contributor

Re: ANSI feature support on compiler

Hi:

Add the '-A' flag.

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: ANSI feature support on compiler

Since you have the ANSI/C compiler installed, you shouldn't be getting these messages. I do assume the the compiler is configured. You will get these messages even with the ANSI C compiler installed and configured if your makefile or CCOPTS variable is asserting the -Ac (traditional K&R) mode. I'm betting that the ANSI C compiler is not in your PATH and you are invoking the Bundled C compiler which only speaks K&R C.
If it ain't broke, I can fix that.
D Block
Advisor

Re: ANSI feature support on compiler


# man cc
might help to determine the ANSI C options: -A or -Ac

try this one:

cat < /tmp/t.c
main()
{
printf("Hello World\n");
}

!

cd /tmp
make t

./t

Dennis Handly
Acclaimed Contributor
Solution

Re: ANSI feature support on compiler

10.20 isn't supported. The C compiler there isn't supported.
This compiler is so old the default is evil K&R.

As JRF hinted, you must specify -Ae or -Ae to compile in ANSI C mode. (Or use c89.)
skt_skt
Honored Contributor

Re: ANSI feature support on compiler

compiled on 11.00 to get it done fast.
Dennis Handly
Acclaimed Contributor

Re: ANSI feature support on compiler

>compiled on 11.00 to get it done fast.

This isn't supported. You can't compile on 11.00 and move back to 10.20.

All you needed to do is add -Ae to your makefile, or "export CCOPTS=-Ae" and build.
skt_skt
Honored Contributor

Re: ANSI feature support on compiler

one of my dba colleague was doing this. He said it worked for him.
Dennis Handly
Acclaimed Contributor

Re: ANSI feature support on compiler

>one of my DBA colleague was doing this. He said it worked for him.

There is a difference between supported and works.

This won't work for C++ because of mangling differences. If you use higher opt levels, you may run into TLS issues.
And libc headers aren't compatible.