Shiva wrote:
> @Varun: #INCLUDE difference is correctly pointed out by Keith. But other than that there are a few differences here and there. Mainly if you are good at C, you would not find programming C on tandem very difficult. You will definitely encounter lot of errors but there are clear descriptions for them so that you can rectify them. I don't remember the differences distinctly; but there's not much. But I can guarantee you that you can't run a code that has been compiled without errors in your windows PC using a GCC compiler. Your tandem compiler will produce errors of its own.
You probably made a poor choice of wording in the above when you said that you can't run a program that works on a PC on the NonStop system without errors. Certainly there are some things that are accepted by gcc or other C compiler for the PC that are not accepted by the C compilers on the NonStop system, but it is not true that every program that works on a PC will not work on a NonStop system. The NMC and CCOMP compilers are noticeably more picky about data type matching and some other similar things than many other compilers are, but those usually result in warnings that may be ignored or suppressed with the WARN pragma. If you set aside those warnings, I think that a lot of programs that work on a PC will work unchanged on a NonStop system, especially if you compile them in the OSS environment. If you compile in the OSS environment but target the Guardian environment by including -Wsystype=guardian on the compile command line, a smaller number of programs will work
unchanged in the Guardian environment.
>
> And like Keith has pointed out, there are three compilers at a higher level. TNS, TNS-R, TNS-E. TNS-E being the latest producing 800 code object. They carry a lot of improvement over TNS compiler, (the following point is only to be considered if you deal with multi version tandem servers as a whole and need to move object code from one to other) but they also make the 'object' unportable to some servers where 800 code is not supported, so in that case TNS compiler would be your go-to. Trust me, when you're moving over multiple versions of tandem servers, you're bound to lose your source code and in that case it is always best to carry portable code - though it brings in the disadvantage of being abled to do less, but enough.
>
I disagree that the TNS C compiler should be used for any new programs
. It is kept around for modifying and enhancing programs that are already implemented in TNS C and are too hard to convert to native-mode C. While it is true that the TNS object files will run in the emulator on any NonStop system, I don't agree that is a strong enough advantage to outweigh using the NMC and CCOMP compilers for new programs. It is true that if you use a native-mode compiler, and if you must use the program on both TNS/R and TNS/E systems, you must compile your code twice and keep track of the two copies of the executable files, but I think it is much better using the modern compilers, not the old TNS C compiler, so the little extra work is worthwhile.
I don't think much of the argument that TNS C is good because if you lose the source code, you still could use the program on any future NonStop system. If you lose the source code for an important program, you are not running your operation in a responsible way. Most programs require some changes or enhancements from time to time, and you cannot do that if you have only the object file. Should you intentionally use a old, out-of-date compiler so that if someone is sloppy about keeping the source code safe, you still can use the unmaintainable program after the next change of CPU? That doesn't seem like the best choice to me.
> If you need any help or assistance regarding C programming on Tandem, feel free to post here. I've done some hard yards learning this by doing them wrong. So you can find help here always. :)
Yes, we are happy to answer questions and help solve problems you cannot figure out. Try to figure out things yourself first, but if you get stuck, don't spin your wheels for an unreasonably long time before asking a question here.