Operating System - HP-UX
1834916 Members
2677 Online
110071 Solutions
New Discussion

Re: cc compiler error 1705

 
SOLVED
Go to solution
Yuri Ignatiev
Occasional Advisor

cc compiler error 1705

I try create shared load module for catia v422 on HP-UX 10.20
compile empty program with
cc -c test.c
shared -p test.o -o TEST
and i have such error message:
api : ========= Creating a shared load ==========
Compiling C source of module header... error
(Bundled) cc: warning 480: The -A option is available only with the C/ANSI C product; ignored.
(Bundled) cc: warning 480: The +z option is available only with the C/ANSI C product; ignored.
(Bundled) cc: "/tmp/lkcat_2003/cathead.c", line 18: error 1705: Function prototypes are an ANSI feature.

Maybe problem in cc compiler, what patch I must set for fix this error?
23 REPLIES 23
Alex Glennie
Honored Contributor

Re: cc compiler error 1705

try using -Ae option as part of the cc comand line options

Olav Baadsvik
Esteemed Contributor

Re: cc compiler error 1705


Hello,

To me it seems that you are passing options to the compiler that it does not recognize.
These are options for the c/ansi-c compiler.
Are you sure you have this compiler installed.
Do a what cc
and
which cc

and you will probably see that cc in your case
is a script that starts the cc compiler with
options it does not recognize.
Check if whereis cc gives /opt/ansic/bin/cc
as output.
If it does not you do not have the c/ansi-c
compiler installed (only the bundled compiler which is a K&R compiler)

Olav
Yuri Ignatiev
Occasional Advisor

Re: cc compiler error 1705

Thanks for answers.
Right now I don't have access to hpux workststion but later I check settings of cc compiler.

catusr: /tmp > type cc
cc is a tracked alias for /usr/bin/cc
catusr: /tmp > what /usr/bin/cc
/usr/bin/cc:
HP92453-01 A.10.32.00 HP C(Bundled) Compiler
/usr/lib/libc: $Revision: 76.3 $

Alex Glennie
Honored Contributor

Re: cc compiler error 1705

man cc ->

-Amode Specify the compilation standard to be used by the
compiler. mode can be one of the following letters:



-Ae -> Extended ANSI mode. Same as -Aa -D_HPUX_SOURCE
+e. This would define the names (macros and
typedefs) provided by the HPUX Operating System
and, in addition, allow the following .....

NB Defaults have changed between 10.20 & 11.x


type cc +help -> Error messages ->
Error 1705
Function prototypes are an ANSI feature.

You have attempted to use function prototypes in Compatibility mode.

Either take out the function prototypes or compile with the -Aa option.


Steve Steel
Honored Contributor
Solution

Re: cc compiler error 1705

Hi

/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 $


Is a not bundled compiler thus you need a compiler to do this properly


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Yuri Ignatiev
Occasional Advisor

Re: cc compiler error 1705

1) erro take place after shared call. That's why I don't think that
cc -Ae test.c
help.
but I try to do this
2) I have gcc and g++ compilers for hpux10.20 but shared util call cc.
I try change link from cc to gcc but call cc from shared don't compatible with call gcc.
(different command string arguments)
Can I find cc compiler for free somewhere?
H.Merijn Brand (procura
Honored Contributor

Re: cc compiler error 1705

# file `which shared`

'shared' is not a standard HP-UX command. Where does it come from. If it is a plain ascii file (shell script), you can probably just edit the script to use gcc in favour of cc

Enjoy, have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
H.Merijn Brand (procura
Honored Contributor

Re: cc compiler error 1705

We, as members of the forum, would like to know if the solutions we propose indeed helped. You can tell us in a post in the thread or - better - by asigning points to all answers, 10 for *the* solution, 0 for posts that did not help at all. Other members can then look at the answers when they search the forum for similar problems they have and find the path to freedom that way.

Read http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x022718276953d61190040090279cd0f9,00.html

Enjoy, have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Yuri Ignatiev
Occasional Advisor

Re: cc compiler error 1705

Where can I found bundlrd cc compiler for free?
Can I use gcc instead it?
How link gcc instead of cc?
Olav Baadsvik
Esteemed Contributor

Re: cc compiler error 1705



Hello,

The bundled compiler is always on the system.
It comes as a part of the standard HP-UX
distribution.
It is there because it is needed when you
reconfigure the kernel.

Do a whereis cc
and you will find it under /usr/bin/cc

Note that this is not an ansi-c compiler but
rather a K&R c-compiler.
For serious program-development I would advise
you to get the c-ansi-c compiler.

Olav

Yuri Ignatiev
Occasional Advisor

Re: cc compiler error 1705

I have such settings:
catusr: /tmp > type cc
cc is a tracked alias for /usr/bin/cc
catusr: /tmp > what /usr/bin/cc
/usr/bin/cc:
HP92453-01 A.10.32.00 HP C(Bundled) Compiler
/usr/lib/libc: $Revision: 76.3 $

Is this bundled cc compiler?
Olav Baadsvik
Esteemed Contributor

Re: cc compiler error 1705


Hello,

Yes, that is the bundled c-compiler

Olav
Yuri Ignatiev
Occasional Advisor

Re: cc compiler error 1705

but I get error 1705, when try compile my program with this compiler.(see above)
File cathead.c is the part of catia 4.2.2 and it must compile without errors.
Olav Baadsvik
Esteemed Contributor

Re: cc compiler error 1705



Hello,

Yes, and this brings us back to square 1.

The bundled c-compiler does not have all
the options the full c-ansi-c compiler
has. From you initial problem description
it is clear that you directly or in some
script pass options to the compiler that it
does not recognize.

Olav
Olav Baadsvik
Esteemed Contributor

Re: cc compiler error 1705



Hello again.

The error 1705 says exactly what your problem
is. The bundled K&R type c-compiler does
not support "function prototypes". That is
a feature of the c-ansi-c compiler.

Olav
Yuri Ignatiev
Occasional Advisor

Re: cc compiler error 1705

Where can I get c-ansi-c compiler or some other compiler that can compile such files for free?
John Poff
Honored Contributor

Re: cc compiler error 1705

Hi,

You can get the gcc compiler which is open source. Here is one place to find it:

http://gcc.gnu.org/

JP
John Poff
Honored Contributor

Re: cc compiler error 1705

Hi again,

Here is a link for a gcc depot from HP-UX Porting Centre mirror in the UK:

http://hpux.connect.org.uk/hppd/hpux/Gnu/gcc-3.2/

JP
H.Merijn Brand (procura
Honored Contributor

Re: cc compiler error 1705

HP's C-ANSI-C is not available for free. GNU gcc however /is/. A precompiled version is available on several places (though finding 10.20 ports is getting harder by the day), my ITRC page is one of those: https://www.beepz.com/personal/merijn/ or http://www.cmve.net/~merijn/

Please consider recompiling gcc from scratch using that port in order to have it adopt to your system.

Enjoy, have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Yuri Ignatiev
Occasional Advisor

Re: cc compiler error 1705

I try use gcc instead of cc, but problem is that shared util call cc compiler an I can't change it.
I add link to gcc at the first place and name it cc.
I get such error message:
api : ========= Creating a shared load ==========

Compiling C source of module header... error
cc: +z: No such file or directory
cc: +DA1.1d: No such file or directory
cc: +DS2.0a: No such file or directory
*Initialization*:1: missing token-sequence in `#assert'

H.Merijn Brand (procura
Honored Contributor

Re: cc compiler error 1705

Hmm, I can only think of a rather sleezy solution: build a *script* wrapper around gcc that is called 'cc' and is found in your path *before* any real cc. Not tested, but to give you a dript:

--8<--- cc
#!/opt/perl/bin/perl

use strict;
use warnings;

my %opt = (
"+z" => "-fpic",
"+Z" => "-fPIC",
"-Ae" => undef,
"-Aa" => "-ansi",
"+O" => "-O",
"+O2" => '-O2",
"+O3" => "-O3",
);
for (@ARGV) {
exists $opt{$_} and $_ = $opt{$_};
}
exec "/your/path/to/gcc", @ARGV;
--8<---

just for starters :)

Enjoy, have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Yuri Ignatiev
Occasional Advisor

Re: cc compiler error 1705

Thanks script work with some modification
foreach $i (@ARGV)
{
if($i eq "prm")
{
@l = (@l, "my_prm");
}
elsif($i eq "prm2")
{
@l = (@l, "my_prm2");
}
elsif($i ne "prm_skip" && $i ne "prm_skip2")
{
@l = (@l, $i);
}
}
exec gcc @l;
But I can't execute created shared module.
I Think problem in skipped parameters optc="-c -Aa +z +DA1.1d +DS2.0a" # C compiler options
I skip +DA1.1d and +DS2.0a.
What eqivalent of this parameters in gcc?
H.Merijn Brand (procura
Honored Contributor

Re: cc compiler error 1705

Those are architectural parameters, and IMHO should *not* be combined. It's either/or, not and.

Anyway, modern versions of gcc (3.2 and up) do support those as

+DA1.1 => -mpa-risc-1-1
+DA2.0 => -mpa-risc-2-0

you can find the architerture dependant available options with. There is no option available for 1.0 or 2.0w. The latter requires a 64bit gcc.

gcc -v --help

Enjoy, have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn