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


Occasional Contributor


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.
Robert Gezelter
Honored Contributor



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


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


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



Occasional Contributor


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)
Honored Contributor


> 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


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.