Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

%CC-W-NOTCOMPAT

 
R SAMANTARAY
Occasional Contributor

%CC-W-NOTCOMPAT

We are migrating from OpenVMS/VAX to OpenVMS/ITNIUM. In an application index is declared as integer variable. During compilation it is giving an error

“ %CC-W-NOTCOMPAT, In this declaration, the type of "index" is not compatible with the type of a previous declaration of "index" at line number 277 in file SYS$COMMON:[SYSLIB]DECC$RTLDEF.TLB;1 (text module STRING) “

Can you suggest how to resolve this problem without changing the name index.
6 REPLIES 6
Robert Gezelter
Honored Contributor

Re: %CC-W-NOTCOMPAT

R SAMANTARAY,

It would be useful to see the actual definition of the variable. It would also be helpful to know the version numbers of the OS and compiler on each architecture.

As a general principal, the C specification and the C compiler have become more strict about language issues over the years. As a guess, I would say that is what happened.

Extracting the relevant module from DECC$RTLDEF.TLB and looking at the identified line is part of understanding what the problem is.

- Bob Gezelter, http://www.rlgsc.com
Richard Whalen
Honored Contributor

Re: %CC-W-NOTCOMPAT

The (old) C compiler that you have been using did not have the index function, which searches for a character in a string.

http://h71000.www7.hp.com/doc/83final/5763/5763pro_042.html#index_x_1138

You might have some luck with one of the following qualifiers on your command line:

/DEFINE=_ANSI_C_SOURCE

or

/DEFINE=(__CRTL_VER=60200000)
R SAMANTARAY
Occasional Contributor

Re: %CC-W-NOTCOMPAT

Vax 4300 VMS 6.2 to Itanium VMS 8.3

Product Producer Units PCL Activ Version Release Termination
C HP 2 0 1 0.0 (none) (none)
Jim_McKinney
Honored Contributor

Re: %CC-W-NOTCOMPAT

> You might have some luck with one of the following qualifiers on your command line

Or, to continue on the theme offered by Richard Whalen, you could change the name of that variable to something other than "index" which now belongs to C's new index() function.
Hein van den Heuvel
Honored Contributor

Re: %CC-W-NOTCOMPAT

If you go to the exact source line pointed to in the error message you see:

277>> char *index(const char *, int);

This definiton will have been in effect early on.

Along with the error message you'll find
a line number (and text) in the source you are trying to compile.

Show it here?

Review that source area and, if you can, just change the definitions in the source to use somethign other than index (my_index, index_number, ...).
I'm sure there are compiler switches and conditional compiles and other trick to keep using the name 'index', but it's probably much easier for all to give in on this point.

hth,
Hein.