HP-UX uses cc -y and cc -g (-y and -g options) C compilation

Hello Experts,
Would you please let me know what "-y " option does with cc compiler on HP-UX?

As I am migrating application from HP-UX to RHEL 5 , at the time of running makefile make -f makefilename on Rhel 5, it is throwing error

cc: unrecognized option '-y'
<command line>:1:2: error: missing '(' after predicate
main_demon_ipt.pc: In function �main�:
main_demon_ipt.pc:812: warning: return type of �main� is not �int�
make: *** [main_demon_ipt.o] Error 1

(May be it is because of gcc compiler used on Rhel5 not cc).

To map cc -y from HP-UX to Linux, I would request what "-y" is doing on HP_UX?

Thank You in advance.

The options are specific to the C-compiler.
On HP-UX /usr/ccs/bin/cc is usually a link to the active one.
The following might find the installed C-compiler(s)

swlist -l product | grep -i compiler

The default (bundled) C-compiler has got a man page

man cc_bundled

It does not have -y and -g options.
See also this URL (that I googled).

1 Like

Thank you for our reply.

I agree with your answer, but we were compiling pro*c source code by using makefile on unix, that has cc -y option and it was compiling as expected.

Please guide me on it.

Pro*c needs a true ansi-C which is not the default on HP ( K&R ) as HP ( dont know if still true as I have no recent boxes to look at...) needed a compiler for recompiling the kernel, so the ansi-C was an option ( $$ ) but I remember an package with special C-libs for oracle ( free when you had support...) which let you relink oracle stuff without having to buy the extra compiler, so would cc -y be for ansi?

Hi Vbe,

Thank You for your response , as it as Pro*c code , so -y for oracle library linking only.

but I am confused what to map it for linux to make it compatible for linux

Have you used the ansi option of gcc?

See.. These are the parameters passed to the makefile on HP-UX.

I have to make it compatible with linux.

#### Shell unix
#
SHELL = / bin / sh

#### Compilation options:
#
OPTIONS_COMPIL =  -y-g

#### Options of linking :
#
OPTIONS_LINK = -xnolib -Bstatic

#### Compiler to use:
#
# HP / SUN
# By default we take the ANSI compiler of softbench (HP)
# To use the SUN compiler to pass as argument to make
# CC = "/ usr / ucb / cc -Xa" (ANSI + KERIGHAN mode)
#
#CC = cc -Aa
CC =/usr/bin/cc -Ae 

PROC=proc define=PROC define=__hpux 

#### Link editor
#
LD = $(CC)

#### Link editor for purification
#
PURIFY = purify /opt/SUNWspro/bin/cc -Xa

#### Archieving objects in liabraries
#
AR = ar

#### Lint (Syntactic analysis)
#
LINT = lint

#### Lint object linker
#
LDLINT = $(LINT)

#### Archieving lint object
#
ARLINT = $(LINT)

#### Generator of dependencies
#
DEPEND = makedepend

#### Command rm
#
RM = rm -f

I think you can remove the -g option, or perhaps change it to "-ggdb", a popular debugging format for gcc allowing you see symbols when the executable or library is used with gdb, the gnu debugger.

The -y option I'm having more trouble finding. It may refer to "static debugging info", if the HP-UX fortran manpage is relevant, or it may be a corruption of -Y, for "default location for libraries" which I doubt since no folder follows it. So remove it.