Operating System - Linux
1753883 Members
7439 Online
108809 Solutions
New Discussion юеВ

Re: Function prototypes are an ANSI feature

 
SOLVED
Go to solution
mark.M
Frequent Advisor

Function prototypes are an ANSI feature

HP-UX B.11.11 ьЮЕыЛИыЛд.
/usr/ccs/bin/cc Boundle installed id now present.

follow error
test.c context...

#include
main(int argc, char **argv)
{
printf("Hello World\n");
}

[by:/test]# cc -o test test.c
(Bundled) cc: "test.c", line 2: error 1705: Function prototypes are an ANSI feature.
[by:/test]#
we are purchas C compiler??
-and-----------------------------------
when ANSI feature compiler..
following context .. bundle CC Compile success.
#include
main(argc, argv)
int argc;
char **argv;
{
printf("Hello World\n");
}
6 REPLIES 6
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Function prototypes are an ANSI feature

This is telling you that the Bundled C compiler only understands K & R syntax. The Bundled compiler is really only intended to be used to build kernels although limited deveopment can be done. If you want to do serious development then you need to purchase the ANSI C compiler or the aCC (C++) compiler. A free alternative is gcc which you can download.
If it ain't broke, I can fix that.
H.Merijn Brand (procura
Honored Contributor

Re: Function prototypes are an ANSI feature

int foo (int bar, char *baz)

is ANSI prototyping and enables the compiler to better check if the arguments passed to the function are correct

int foo ()
int bar;
char *baz;
{

is K&R C and does not allow those checks

You are using HP's bundled C compiler, which is NOT ANSI compliant, and also sometimes refered to as the braindead compiler. It's only useful for compiling the kernel

If you want/need ANSI features, buy HP C-ANSI-C or install GNU gcc

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Sandman!
Honored Contributor

Re: Function prototypes are an ANSI feature

Verify whether you have the ANSI-C compiler on your system.

# swlist -l product | grep -i "ansi c"

cheers!
Rory R Hammond
Trusted Contributor

Re: Function prototypes are an ANSI feature

looks like you have not yet installed the compiler.

You will have to go online to get a code word and install. I don't think it requires a reboot.last time I installed was 2/2005
and it was on CD #5013-2240

Rory
There are a 100 ways to do things and 97 of them are right
Yarema A. Mikhajliv
Frequent Advisor

Re: Function prototypes are an ANSI feature

Where can I get this bundle?
I'm not a company member of DSPP, so I cant download it...
OldSchool
Honored Contributor

Re: Function prototypes are an ANSI feature

Note that its a purchase product / codeword locked on distribution cd's

You might consider, as noted above, the GNU C compiler