Waterloo C Development System

for MVS and VM/CMS

Delivers the highest quality C language programming environment for IBM mainframes

File: TRAVERSE Func: copy_root Line: 165 State: breakpoint 162 #ifdef DEBUGGING_ENABLED -- Local environment: ------- 163 printf( "copy_root( root: %#010x, targe | copy_root(root = 0X75B50, | 164 root, target ); | target = 0X75B74) | 165 #endif | msgbuffer = 0X75C20 | 166 if( root == NULL ) | child_counter = 2 | 167 return( NULL ); | child = 0X75B68 | 168 ----------------------------- 169 msgbuffer = alloca( strlen( root->node_name ) + 1 ); 170 strcpy( msgbuffer, root->node_name ); 171 memupr( msgbuffer + 10, 5 ); 172 printf( "Node: '%s'\n", msgbuffer ); 173 174 child = root->node_children; 175 for( child_counter = root->node_child_count; 176 child_counter; 177 --child_counter ) 178 { s>179 copy_child( *child, target ); 180 ++child; 181 } 1-Go 2-Stop 3-Mode 4-Step 5-Next 6-Stat 7-Where 8-Up 9-Down 10-Help Waterloo C Debugger Reading symbolic information ... stop at 179 print *root,**child {node_name = "CRUMBLY COOKIES LTD.", node_child_count = 2 (0x2), node_children = {0X75B74, 0X75B98, (NULL)}} {node_name = "CHARRED STEAK HOUSE", node_child_count = 0 (0), node_children = {0X207E0, 0X208E1, 0X74320}} edit nodedef h_

Product Specifications


Waterloo C is a production-oriented C language development system for IBM mainframes with MVS or VM/CMS. It includes:

The Total Package

The Waterloo C Development System is a complete package for IBM mainframes. The optimizing compiler runs in a single phase, from the integrated preprocessor direct to high-performance object code generation. There is no need for an assembly step, thus decreasing compilation time and increasing productivity.

The full-screen, source-level debugger can display source code, machine code, registers, disassembled object code and data areas. The interactive environment significantly reduces debugging time.

The Waterloo C Tools comprise a set of programs to enhance the Waterloo C programming environment. The package is designed to improve productivity at each stage of C program development.

Waterloo C is ideal for porting existing software written in C on other systems, such as UNIX, to the IBM mainframe under MVS or VM/CMS. Of course, it serves equally well for new software development.

Benefits of C


Often programs can be written more efficiently in C than other languages due to C's rich expressive power. The nature of C allows it to be compiled into high-performance machine code with state-of-the-art compilers, such as Waterloo C.


C is available on many different computing systems. Software can be written in C so that it is easily adapted to numerous environments.


C is a true general-purpose language: simple and powerful. The capability of C has been thoroughly demonstrated in numerous areas: data base, graphics, operating systems and applications.

Waterloo C Highlights

Compiler Features

ANSI Standard Support

Waterloo C is compatible with the ANSI standard for the C programming language. Significant new language features described in this standard are:

Error Diagnosis

Waterloo C optionally produces warnings for questionable type matches, operations and statements.

High-Performance Compiler

The compiler is a single phase, resulting in fast compilation.

In-line Function Code

Several frequently used C library functions can be expanded in-line for greater execution speed.

Read/Write Split Option

The compiler optionally generates two object files: one containing code and read-only data, and the other containing read-write data.

Reentrant Code

The compiler can generate register-based addressing code for all read/write data, which allows automatic generation of reentrant code.

OS-style Linkage conventions

Waterloo C optionally generates code which supports OS-style linkage conventions. This allows C programs to call routines with OS linkage conventions, and programs written with OS conventions to call C functions. There are several choices for the allocation and control of the C run-time stack which make this facility more convenient to use.

Run-time Stack Overflow Checking

Waterloo C can check the run-time stack for an overflow condition. The condition is processed by the exception handling facilities in the run-time library.

Direct Object-code Production

Object code is produced directly by the compiler, with no need for a separate assembly step. Assembler source code is optionally generated.

Powerful Optimizer

An optional optimization phase improves the generated code using flow analysis and improved register allocation. The user can control the level of optimization performed.

Global Base-register Facility

A global base-register facility is provided for very efficient implementation of external variables.

C Run-time Library Features

The Waterloo C Run-time Library is an extensive collection of C macros, functions, types and variables, and assembler support routines that provide a run-time environment for programs that are compiled with the Waterloo C compiler.

ANSI Standard Support

The Waterloo C Run-time Library is compatible with the ANSI standard for the C programming language.

Library Function Prototypes

Header files provide function prototypes for the various sections of the library. This significantly improves compile-time error diagnosis of incorrectly used C library functions.

Common Library

Waterloo C dynamically determines what features are available in the operating system. A single run-time library for VM/CMS can be used with VM/ESA (ESA or 370), VM/XA, VM/HPO or VM/SP. Similarly just one library for MVS interfaces to MVS/ESA, MVS/XA and MVS/SP.

Directory Support

The directory support functions opendir, readdir and closedir support wild-card file-name specifications. For MVS, wild-cards are supported in both dataset names and PDS member names.

Efficient Library Organization

Most library functions are in separate CSECTs so that extra, unnecessary code will not be included in executable modules.

Source Provided

C and assembler source code is provided for the system-dependent portion of the library, so that installations may conveniently make alterations to suit their needs.

Macros for Efficiency

Many functions are implemented as C preprocessor macros or written in assembler for maximum efficiency.

Exception Handling

System- and user-generated interrupts and exceptions can be intercepted and controlled with the signal and gsignal functions.

Special Enhancements for MVS

Diagnostics Summary File

Compiler diagnostics are written to the terminal, as well as the DD SYSLIST. This feature makes it convenient to stay in the editor during the edit-compile process.

System Interface

Functions are provded which allow system programmers to issue a variety of MVS and TSO macro calls directly from programs written in C.

Library Resident in Link Pack Area

The Waterloo C library can reside in the MVS link pack area, allowing significant savings in module size. This version of the library is "pre-linked" which results in savings in the link time for applications.

Special Enhancements for VM/CMS

XEDIT Support

Special XEDIT support permits compilation of programs from within the editor for faster program development. Source is read directly from XEDIT internal storage for efficiency.

Diagnostics Summary File

Diagnostics are written to both the terminal and a file of type ERRS. This feature, in conjunction with XEDIT support, makes it convenient to stay in the editor during the edit-compile process. Combined with Waterloo C's fast compilation rate, this provides a development environment with outstanding convenience and productivity.

Access to CMS Global Variables

The functions getenv and putenv can be used to access and modify any CMS GLOBALV variables.

System Interface

Numerous interface functions provide system programmers with the capability to issue DIAGNOSE instructions, CMS macro calls, and CMS callable services library function calls directly from programs written in C.

Library Resident in Shared Segment or Nucleus Extension

The Waterloo C Run-time Library can reside in a shared segment or nucleus extension, allowing significant savings in module size. This version of the library is "pre-linked" which saves application link time.

Shared Segment Resident Compiler

Sites where Waterloo C is used heavily by many users will benefit from the ability of the compiler to reside in a shared segment.

CMS Native File System

Input/output functions are implemented using the CMS file system directly. FILEDEFs can be used, but are not required.

Efficient CMS File Representation

Files are represented using CMS conventions for efficiency and convenience. The optional byte-stream oriented file representation closely simulates UNIX files.

Access to XEDIT Buffers

The C library input/output facilities can process files stored in XEDIT internal storage. This permits programs written in Waterloo C to be executed very conveniently from XEDIT.

REXX Macro Access

An easy to use interface to the CMS SUBCOM facility is provided so that C applications, such as the Waterloo C Debugger, can fully exploit the facilities of the powerful REXX macro language.

The Waterloo C Debugger

Debugging becomes a more productive and efficient activity in this interactive, flexible environment. Programs can be examined and manipulated at the source level, changing variable values and displaying intermediate results until problems are located.

Full-screen Interface

The debugger provides a screen-oriented user interface, as well as a line mode of interaction. This significantly increases the bandwidth between the programmer and the system, which improves productivity.

Source-level Access

Source variables, functions and lines are the basis for debugging activity. Symbolic information for the debugger is produced in a separate file by the Waterloo C compiler: object files are unchanged, and recompilation is not usually necessary.

Comprehensive Expression Interpreter

Commands which use expressions, such as print, stop and trace, support C operators and data types including struct, union and enum.

Debugging Features

Debugging facilities include: tracing functions, lines or variables; stopping at a function or line; stopping when a specific variable changes value; stepping through source one or more lines at a time.

Two different single-step features allow both stepping over and stepping through function calls.

A conditional activation feature allows a trace or stop to occur only when a source-level expression is true.

Machine-level Access

A function key instantly switches between the default full-screen source code display to full-screen machine-level display. The machine-level display includes disassembled object code, registers and the PSW.

The debugger automatically enters machine-level mode when source information is unavailable (for example, in assembler routines).

Machine instructions can be used as the basis for tracing, stopping or single-stepping. Calls can be followed or passed over.

Address calculation for display or breakpoints is made powerful through the availability of source-level information and rich expression operators.

Execution Environment

Simple commands access the program environment easily. Problems can be isolated by setting variable values, calling functions or changing the stack frame to move back in the call sequence.

A powerful system command environment allows other programs to be run, editor access to source code or program data files - including ISPF (or XEDIT on VM/CMS), and other system commands to be entered.

Program exceptions are handled gracefully: control returns to the debugger and a traceback displays the problem.

Traceback information showing a call history with source lines and function arguments can be displayed any time the program is halted.

Programmer Productivity Tools

3270 Full-screen Panel Library

A comprehensive library is provided to support full-screen applications. The full-screen library has a high-level interface suitable for applications programming, as well as a low-level interface providing more direct control over display devices.

Pattern Locator: GREP

Finding a variable name occurrence in a large set of files is easy with a pattern locator. Search patterns can be simple strings or regular expressions. Meta-characters provide beginning and end of line or column, and single or multiple character ranges. Search options include case sensitivity, column restriction, reversing and exact line matching.

File Comparator: DIFF

DIFF summarizes recent updates by comparing a file against a previous copy or, for VM/CMS, an active XEDIT editing session against its disk file. Comparison options include case sensitivity, column restriction, compression, and binary or hex format.

Object File Cross-reference: TXTREF

Global symbols from any set of object files (for VM/CMS, both TEXT and TXTLIB files) are sorted and indexed. Accompanying each symbol is the location of its definition and a list of references to it.

Additional Tools for Waterloo C for VM/CMS:

Performance Analysis: TIMEMAP, PROF and TIMER

These utilities produce a symbolic execution-time profile for Waterloo C programs. They are particularly useful for performance monitoring and improvement.

Symbol Cross-reference: CXREF

This utility provides a cross-reference of the symbols in single or multiple source files. Symbols contained in header files and macros can be optionally included.

Program Maintenance Utilities: MAKE and MKMK

With a single command, all actions necessary to bring a program and its components up-to-date are performed. Updating is guided by a description file containing entries that describe dependencies between files. The MKMK (make-make) utility assists the programmer in preparing the description file. File types, like TEXT or C, can be recognized as being related. An internal inferencing mechanism can check such dependencies and perform updating implicitly.

Listing Generator: CLISTING

Error diagnostics are merged with program source to create output suitable for printing.

Source Formatter: CF

This utility will format source code in a choice of styles.


Waterloo C is provided with extensive online documentation. It is organized so that a user can quickly obtain specific information regarding the compiler, library, debugger and development tools.

The Waterloo C Development System User's Guide is the comprehensive manual for Waterloo C users. It includes descriptions of compiler operation, compilation options, system-specific features and interfacing to other high-level languages and assembler code. Tutorials introduce many components of the development environment. Reference sections for the compiler and the development tools provide complete specifications for day-to-day use of the system.

The WATCOM C and Waterloo C Language Reference contains a concise definition of the language accepted by Waterloo C.

The Waterloo C Run-time Library Reference provides complete details for each of the functions available in the Waterloo C library. Function descriptions include parameter and return value types, descriptions, usage considerations and cross-references to related functions.

The Waterloo C Panel Library Reference is a separate reference source for the functions in this specialized application library. An introductory tutorial is featured in the User's Guide.

The Waterloo C Development System Installation Guide describes the steps required to install the Waterloo C Compiler and Library, Panel Library, Debugger, and Development Tools. The guide also details system prerequisites, and the installation verification procedure.


Licenses include major new releases as well as maintenance updates at no additional charge.

UNIX is a registered trademark of UNIX System Laboratories, Inc.