This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cc and gcc compilers


Jim Wilson wrote:
Nguyen, KhaiDinh wrote:

We are migating many C programs from (old) NCR Unix system to AIX.
These C programs are non-ansi standard and compiled by using NCR unix cc
compiler.


See http://gcc.gnu.org/bugs.html for info on how to report bugs.

This report is very confusing. In one place you imply that the C code is very old, and thus pre-dates ANSI C (aka ISO C90). In another place, you imply that the code won't compile because it uses an ISO C99 feature, and thus post dates ANSI C (aka ISO C90). Which is it? A testcase would be very helpful to eliminate the confusion. If we don't know what exact problem you are seeing, then we may not be able to help.

Jim,


I think you're misreading the situation.

Mr. Nguyen said that the system was an old NCR Unix system, not that the
code was pre-ANSI C.  (He said that the code was *non-ANSI*, not pre-ANSI.)
He also said that the code used features like "variable declared after
statements/variable assignments".  It turns out that this is a extension
provided by NCR's proprietary High Performance C/C++ Compiler.  This
compiler defines a language called High C which has a bunch of extensions
to ANSI standard C.  It can also operate in strict ANSI-compatible mode.
Or it can operate in a pre-ANSI compatible mode which also allows limited
usage of ANSI constructs and High C extensions.

I found a manual for this compiler, dated 12/1997, on NCR's web site:

http://www.info.ncr.com/eDownload.cfm?itemid=980790019&fulltxt=Yes

It's a PDF.  Page 305 of the manual describes the mixed declarations and
statements extension; this page is part of Appendix F, which starts on
page 294 and describes the extensions provided by High C.

In short, it sounds like Mr. Nguyen's code uses NCR proprietary extensions.
For that code to work on other systems, those extensions must be removed.
If Mr. Nguyen's team is very lucky, the extensions they used might just
happen to fall under the new ISO C99 standard, so compiling in that mode
might work; more likely, they will have to convert the code themselves,
possibly with the help of automated scripts.  The NCR compiler may be able
to help in that conversion; for example, the -Hansi option enforces strict
ANSI compliance, and might be usable to flag usage of extensions; also
some specific compiler features can be controlled with toggles (I don't
think that mixing statements and declarations is one of those).

Colin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]