Open WATCOM User's Guide

Total Page:16

File Type:pdf, Size:1020Kb

Open WATCOM User's Guide this document downloaded from... Use of this document the wings of subject to the terms and conditions as flight in an age stated on the website. of adventure for more downloads visit our other sites Positive Infinity and vulcanhammer.net chet-aero.com Open Watcom FORTRAN 77 User's Guide Version 1.8 Notice of Copyright Copyright 2002-2008 the Open Watcom Contributors. Portions Copyright 1984-2002 Sybase, Inc. and its subsidiaries. All rights reserved. Any part of this publication may be reproduced, transmitted, or translated in any form or by any means, electronic, mechanical, manual, optical, or otherwise, without the prior written permission of anyone. For more information please visit http://www.openwatcom.org/ ii Preface The Open Watcom FORTRAN 77 Optimizing Compiler (Open Watcom F77) is an implementation of the American National Standard programming language FORTRAN, ANSI X3.9-1978, commonly referred to as FORTRAN 77. The language level supported by this compiler includes the full language definition as well as significant extensions to the language. Open Watcom F77 evolved out of the demands of our users for a companion optimizing compiler to Open Watcom's WATFOR-77 "load-and-go" compiler. The "load-and-go" approach to processing FORTRAN programs emphasizes fast compilation rates and quick placement into execution of FORTRAN applications. This type of compiler is used heavily during the debugging phase of the application. At this stage of application development, the "load-and-go" compiler optimizes the programmer's time ... not the program's time. However, once parts of the application have been thoroughly debugged, it may be advantageous to turn to a compiler which will optimize the execution time of the executable code. Open Watcom F77 is a highly optimizing compiler based on the code generation technology that was developed for Open Watcom's highly-praised C and C++ optimizing compilers. Open Watcom F77 is a traditional compiler in the sense that it creates object files which must be linked into an executable program. The Open Watcom FORTRAN 77 User's Guide describes how to use Open Watcom FORTRAN 77 with DOS, OS/2, Windows 3.x, Windows NT, and Windows 95. Acknowledgements This book was produced with the Open Watcom GML electronic publishing system, a software tool developed by WATCOM. In this system, writers use an ASCII text editor to create source files containing text annotated with tags. These tags label the structural elements of the document, such as chapters, sections, paragraphs, and lists. The Open Watcom GML software, which runs on a variety of operating systems, interprets the tags to format the text into a form such as you see here. Writers can produce output for a variety of printers, including laser printers, using separately specified layout directives for such things as font selection, column width and height, number of columns, etc. The result is type-set quality copy containing integrated text and graphics. We would like to thank IMSL of Houston, Texas for providing us with copies of their Mathematics and Statistics libraries. The IMSL Math Library is a collection of subprograms for mathematical problem solving and the Statistics Library is a collection of subprograms for statistical analysis. The self test procedures provided with these libraries proved to be an immense help in testing Open Watcom F77 on the personal computer. We also used the "FORTRAN Compiler Validation System, Version 2.0" to test the conformance of Open Watcom F77 with the full FORTRAN 77 language standard. This package is provided by the National Technical Information Service of the U.S. Department of Commerce in Springfield, Virginia. The validation system was developed by the Federal Software Testing Center. If you find problems in the documentation or have some good suggestions, we would like to hear from you. July, 1997. iii Trademarks Used in this Manual AutoCAD Development System is a trademark of Autodesk, Inc. DOS/4G is a trademark of Tenberry Software, Inc. IBM Developer's WorkFrame/2, Presentation Manager, and OS/2 are trademarks of International Business Machines Corp. IBM is a registered trademark of International Business Machines Corp. Intel and Pentium are registered trademarks of Intel Corp. Microsoft, Windows and Windows 95 are registered trademarks of Microsoft Corp. Windows NT is a trademark of Microsoft Corp. NetWare, NetWare 386, and Novell are registered trademarks of Novell, Inc. Phar Lap, 286|DOS-Extender, and 386|DOS-Extender are trademarks of Phar Lap Software, Inc. QNX is a trademark of QNX Software Systems Ltd. WATCOM is a trademark of Sybase, Inc. and its subsidiaries. iv Table of Contents Open Watcom FORTRAN 77 User's Guide ................................................................................................... 1 1 About This Manual ........................................................................................................................... 3 2 Open Watcom FORTRAN 77 Compiler Options ............................................................................. 5 2.1 Open Watcom F77 Options Summary ............................................................................... 5 2.2 Compiler Options ............................................................................................................... 8 3 The Open Watcom FORTRAN 77 Compiler ................................................................................... 23 3.1 Open Watcom FORTRAN 77 Command Line Format ..................................................... 23 3.2 WFC/WFC386 Environment Variables ............................................................................. 24 3.3 Open Watcom FORTRAN 77 Command Line Examples ................................................. 24 3.4 Compiler Diagnostics ......................................................................................................... 25 3.5 Open Watcom FORTRAN 77 INCLUDE File Processing ................................................ 27 4 The Open Watcom FORTRAN 77 Libraries .................................................................................... 29 4.1 Open Watcom FORTRAN 77 80x87 Emulator Libraries .................................................. 31 4.2 The "NO87" Environment Variable ................................................................................... 32 5 Open Watcom FORTRAN 77 Compiler Directives ......................................................................... 33 5.1 Introduction ........................................................................................................................ 33 5.2 The EJECT Compiler Directive ......................................................................................... 33 5.3 The INCLUDE Compiler Directive ................................................................................... 34 5.4 The PRAGMA Compiler Directive ................................................................................... 35 5.5 The DEFINE Compiler Directive ...................................................................................... 35 5.6 The UNDEFINE Compiler Directive ................................................................................. 36 5.7 The IFDEF, IFNDEF and ENDIF Compiler Directive ...................................................... 36 5.8 The ELSE Compiler Directive ........................................................................................... 37 5.9 The ELSEIFDEF and ELSEIFNDEF Compiler Directive ................................................. 37 5.10 Debugging statements ("D" in Column 1) ....................................................................... 37 5.11 General Notes About Compiler Directives ...................................................................... 38 6 Open Watcom FORTRAN 77 File Handling ................................................................................... 39 6.1 Record Access .................................................................................................................... 39 6.2 Record Format .................................................................................................................... 39 6.2.1 FORMATTED Records ....................................................................................... 40 6.2.2 UNFORMATTED Records ................................................................................. 40 6.2.3 Files with no Record Structure ............................................................................ 41 6.3 Attributes of Files ............................................................................................................... 41 6.3.1 Record Type ........................................................................................................ 42 6.3.2 Record Size .......................................................................................................... 43 6.3.3 Print File Attributes ............................................................................................. 43 6.3.4 Input/Output Buffer Size ..................................................................................... 44 6.3.5 File Sharing .......................................................................................................... 44 6.4 File Names in the FAT File System ................................................................................... 45 6.4.1 Special DOS Device Names ...............................................................................
Recommended publications
  • KDE 2.0 Development, Which Is Directly Supported
    23 8911 CH18 10/16/00 1:44 PM Page 401 The KDevelop IDE: The CHAPTER Integrated Development Environment for KDE by Ralf Nolden 18 IN THIS CHAPTER • General Issues 402 • Creating KDE 2.0 Applications 409 • Getting Started with the KDE 2.0 API 413 • The Classbrowser and Your Project 416 • The File Viewers—The Windows to Your Project Files 419 • The KDevelop Debugger 421 • KDevelop 2.0—A Preview 425 23 8911 CH18 10/16/00 1:44 PM Page 402 Developer Tools and Support 402 PART IV Although developing applications under UNIX systems can be a lot of fun, until now the pro- grammer was lacking a comfortable environment that takes away the usual standard activities that have to be done over and over in the process of programming. The KDevelop IDE closes this gap and makes it a joy to work within a complete, integrated development environment, combining the use of the GNU standard development tools such as the g++ compiler and the gdb debugger with the advantages of a GUI-based environment that automates all standard actions and allows the developer to concentrate on the work of writing software instead of managing command-line tools. It also offers direct and quick access to source files and docu- mentation. KDevelop primarily aims to provide the best means to rapidly set up and write KDE software; it also supports extended features such as GUI designing and translation in con- junction with other tools available especially for KDE development. The KDevelop IDE itself is published under the GNU Public License (GPL), like KDE, and is therefore publicly avail- able at no cost—including its source code—and it may be used both for free and for commer- cial development.
    [Show full text]
  • Note on Using the CS+ Integrated Development Environment
    Tool News RENESAS TOOL NEWS on April 16, 2015: 150416/tn2 Note on Using the CS+ Integrated Development Environment When using the CS+ IDE, take note of the problem described in this note regarding the following point. Statements in source code which form a deeply-nested block 1. Products Concerned Products from the following list for which the version number of the CS+ common program is 3.00.00 to 3.01.00. - RX Family C/C++ Compiler Package (with IDE) - RL78 Family C Compiler Package (with IDE) - RH850 Family C Compiler Package (with IDE) - CS+ evaluation edition To check the version number of the product you have, refer to the following URL. https://www.renesas.com/cubesuite+_ver 2. Description CS+ might be terminated forcibly when a program is downloaded to a debugging tool or when an editor panel is opened after downloading a program. 3. Conditions Forced termination may occur when the source code for a project includes code that meets any of the following conditions. (a) { } blocks nested to a depth of 128 or more within a function. (b) 64 or more consecutive "else if" conditions are in sequence. (c) The total of double the number of consecutive "else if" conditions and the depth of the nesting of {} blocks at some point in the sequence of consecutive "else if" conditions is 128 or more. With conditions (b) and (c) above, the problem only arises when the C99 option is designated and the product is the RX family C/C++ compiler package (with IDE). 4. Workaround To avoid this problem, do any of the following.
    [Show full text]
  • Embrace and Extend Approach (Red Hat, Novell)
    Integrated Development Environments (IDEs) Technology Strategy Chad Heaton Alice Park Charles Zedlewski Table of Contents Market Segmentation.............................................................................................................. 4 When Does the IDE Market Tip? ........................................................................................... 6 Microsoft & IDEs ................................................................................................................... 7 Where is MSFT vulnerable?................................................................................................. 11 Eclipse & Making Money in Open Source........................................................................... 12 Eclipse and the Free Rider Problem ..................................................................................... 20 Making Money in an Eclipse World?................................................................................... 14 Eclipse vs. Microsoft: Handicapping the Current IDE Environment ................................... 16 Requirements for Eclipse success......................................................................................... 18 2 Overview of the Integrated Development Environment (IDE) Market An Integrated Development Environment (IDE) is a programming environment typically consisting of a code editor, a compiler, a debugger, and a graphical user interface (GUI) builder. The IDE may be a standalone application or may be included as part of one or more existing
    [Show full text]
  • The C Programming Language
    The C programming Language The C programming Language By Brian W. Kernighan and Dennis M. Ritchie. Published by Prentice-Hall in 1988 ISBN 0-13-110362-8 (paperback) ISBN 0-13-110370-9 Contents ● Preface ● Preface to the first edition ● Introduction 1. Chapter 1: A Tutorial Introduction 1. Getting Started 2. Variables and Arithmetic Expressions 3. The for statement 4. Symbolic Constants 5. Character Input and Output 1. File Copying 2. Character Counting 3. Line Counting 4. Word Counting 6. Arrays 7. Functions 8. Arguments - Call by Value 9. Character Arrays 10. External Variables and Scope 2. Chapter 2: Types, Operators and Expressions 1. Variable Names 2. Data Types and Sizes 3. Constants 4. Declarations http://freebooks.by.ru/view/CProgrammingLanguage/kandr.html (1 of 5) [9/6/2002 12:20:42 ] The C programming Language 5. Arithmetic Operators 6. Relational and Logical Operators 7. Type Conversions 8. Increment and Decrement Operators 9. Bitwise Operators 10. Assignment Operators and Expressions 11. Conditional Expressions 12. Precedence and Order of Evaluation 3. Chapter 3: Control Flow 1. Statements and Blocks 2. If-Else 3. Else-If 4. Switch 5. Loops - While and For 6. Loops - Do-While 7. Break and Continue 8. Goto and labels 4. Chapter 4: Functions and Program Structure 1. Basics of Functions 2. Functions Returning Non-integers 3. External Variables 4. Scope Rules 5. Header Files 6. Static Variables 7. Register Variables 8. Block Structure 9. Initialization 10. Recursion 11. The C Preprocessor 1. File Inclusion 2. Macro Substitution 3. Conditional Inclusion 5. Chapter 5: Pointers and Arrays 1.
    [Show full text]
  • FEI~I<Ts Ltistttute NEWS LETTER
    NEWS LETTER FEI~I<tS ltiSTtTUTE from l\Yron J. Brophy, President VOL. 1. NO.7 Big Rapids, !.Iichigan July 23, 1951 . BUlmmG ffiOOR,i1SS. Mon~ Progress Meeting was held at the site at 1 p.m. Wednesday, Jul¥ lB. Those present were: For the Institution" . President Brophy, It'. Pattullo" and Mr. DeMOSS; for the Building Division" Mr. J. ~-'angema.n, and 11:r. Arthur Decker, the project Superintendent; for the IJuskegon Construction Company, Mr. Smith and Mr. Mastenbrook; fC1!.' t...~e Distel Heating Company, ur. Holgate; and for the Electric Construction t.; Machiner"J COmpany, ur. Brabon and Mr. Knight,; and for the Architect, l!r'. Roger Allen. Mr. Allen reported that the color scheme for all rooms in the East Wing has been determined. Mr. lD:rnest King, from the architect1s office, conferred With l!r. pattullo Friday to discuss the preparation of similar color schemes for the Vlest Wing. Work on General C~struction is proceeding rapidq and all mechanical contractors are keeping up with the construction. All structural steel roof framing for the one-story sections will be in place by the middle of this 'week and will be ready to receiVe steel roof deck. ];!t'. Smith hB.f3 received word from the Detroit Steel Products Company (sub­ contractors for the steel deck) that this material Will be Shipped some­ time bet\"loon July 30th and August loth. The fin!ll poUring of cement sla.bin the classroom building was completed last l'leck. The stone Window Sills have been received and installation has started. The alllnlinum vlindow frames Bl'e now being in­ stalled and arc ready for the laying of the glass blockS.
    [Show full text]
  • 2.3.7 80X86 Floating Point
    Open Watcom C/C++ Compiler Options data segment. For example, the option "zt100" causes all data objects larger than 100 bytes in size to be implicitly declared as far and grouped in other data segments. The default data threshold value is 32767. Thus, by default, all objects greater than 32767 bytes in size are implicitly declared as far and will be placed in other data segments. If the "zt" option is specified without a size, the data threshold value is 256. The largest value that can be specified is 32767 (a larger value will result in 256 being selected). If the "zt" option is used to compile any module in a program, then you must compile all the other modules in the program with the same option (and value). Care must be exercised when declaring the size of objects in different modules. Consider the following declarations in two different C files. Suppose we define an array in one module as follows: extern int Array[100] = { 0 }; and, suppose we reference the same array in another module as follows: extern int Array[10]; Assuming that these modules were compiled with the option "zt100", we would have a problem. In the first module, the array would be placed in another segment since Array[100] is bigger than the data threshold. In the second module, the array would be placed in the default data segment since Array[10] is smaller than the data threshold. The extra code required to reference the object in another data segment would not be generated. Note that this problem can also occur even when the "zt" option is not used (i.e., for objects greater than 32767 bytes in size).
    [Show full text]
  • Top Productivity Tips for Using Eclipse for Embedded C/C++ Developers
    Top Productivity Tips for Using Eclipse for Embedded C/C++ Developers Garry Bleasdale, QNX Software Systems, [email protected] Andy Gryc, QNX Software Systems, [email protected] Introduction This paper presents a selection of Eclipse IDE tips and tricks gathered from: the QNX® development community: our engineers, techies and trainers Foundry27, the QNX Community Portal for open development, where we have an Eclipse IDE forum Eclipse.org forums public web sites and blogs that offer Eclipse-related expertise The 27 tips described in this paper are the tips that we received from these sources and identified as most interesting and useful to developers. We present them here with the hope that they will help make you more productive when you use the Eclipse IDE. About Eclipse A modern embedded system may employ hundreds of software tasks, all of them sharing system resources and interacting in complex ways. This complexity can undermine reliability, for the simple reason that the more code a system contains, the greater the probability that coding errors will make their way into the field. (By some estimates, a million lines of code will ship with at least 1000 bugs, even if the code is methodically developed and tested.) Coding errors can also compromise security, since they often serve as entry points for malicious hackers. No amount of testing can fully eliminate these bugs and security holes, as no test suite can anticipate every scenario that a complex software system may encounter. Consequently, system designers and software developers must adopt a “mission-critical mindset” and employ software architectures that can contain software errors and recover from them quickly.
    [Show full text]
  • Using the Java Bridge
    Using the Java Bridge In the worlds of Mac OS X, Yellow Box for Windows, and WebObjects programming, there are two languages in common use: Java and Objective-C. This document describes the Java bridge, a technology from Apple that makes communication between these two languages possible. The first section, ÒIntroduction,Ó gives a brief overview of the bridgeÕs capabilities. For a technical overview of the bridge, see ÒHow the Bridge WorksÓ (page 2). To learn how to expose your Objective-C code to Java, see ÒWrapping Objective-C FrameworksÓ (page 9). If you want to write Java code that references Objective-C classes, see ÒUsing Java-Wrapped Objective-C ClassesÓ (page 6). If you are writing Objective-C code that references Java classes, read ÒUsing Java from Objective-CÓ (page 5). Introduction The original OpenStep system developed by NeXT Software contained a number of object-oriented frameworks written in the Objective-C language. Most developers who used these frameworks wrote their code in Objective-C. In recent years, the number of developers writing Java code has increased dramatically. For the benefit of these programmers, Apple Computer has provided Java APIs for these frameworks: Foundation Kit, AppKit, WebObjects, and Enterprise Objects. They were made possible by using techniques described later in Introduction 1 Using the Java Bridge this document. You can use these same techniques to expose your own Objective-C frameworks to Java code. Java and Objective-C are both object-oriented languages, and they have enough similarities that communication between the two is possible. However, there are some differences between the two languages that you need to be aware of in order to use the bridge effectively.
    [Show full text]
  • GCC Toolchain Eclipse Setup Guide
    !"#$ % '#((#()*!+,-.#)/$01234 GCC Toolchain Eclipse Setup Guide WP0001 Version 5 September 23, 2020 Copyright © 2017-2020 JBLopen Inc. All rights reserved. No part of this document and any associated software may be reproduced, distributed or transmitted in any form or by any means without the prior written consent of JBLopen Inc. Disclaimer While JBLopen Inc. has made every attempt to ensure the accuracy of the information contained in this publication, JBLopen Inc. cannot warrant the accuracy of completeness of such information. JBLopen Inc. may change, add or remove any content in this publication at any time without notice. All the information contained in this publication as well as any associated material, including software, scripts, and examples are provided “as is”. JBLopen Inc. makes no express or implied warranty of any kind, including warranty of merchantability, noninfringement of intellectual property, or fitness for a particular purpose. In no event shall JBLopen Inc. be held liable for any damage resulting from the use or inability to use the information contained therein or any other associated material. Trademark JBLopen, the JBLopen logo, TREEspanTM and BASEplatformTM are trademarks of JBLopen Inc. All other trademarks are trademarks or registered trademarks of their respective owners. Contents 1 Overview 1 1.1 About Eclipse ............................................. 1 2 Eclipse Setup Guide (Windows) 2 2.1 MSYS2 Installation .......................................... 2 2.2 Eclipse Installation .......................................... 11 2.3 Toolchain Installation ......................................... 16 2.4 Environment Variable Setup ..................................... 17 2.4.1 PATH Environnement Variable Setup ........................... 17 3 Eclipse Setup Guide (Linux) 22 3.1 Eclipse Installation .......................................... 22 3.2 Toolchain Installation ......................................... 27 3.3 GNU Make Installation .......................................
    [Show full text]
  • Pascalabc.NET (Версия 3.0)
    К.Ю. Поляков Новые возможности PascalABC.NET (версия 3.0) По материалам С.С. Михалковича (http://pascalabc.net) К.Ю. Поляков, 2015 http://kpolyakov.spb.ru Новые возможности PascalABC.NET 2 «Стандартный» Паскаль сегодня . классический учебный язык . популярен в школах России . хватает для сдачи ЕГЭ Тенденции в программировании: . Размер программы и скорость работы не критичны . Важна скорость разработки и надёжность . Нет современных типов данных (словари, списки, стеки и т.д.) . Нет высокоуровневых средств . Нет стандартных библиотек (типа STL) К.Ю. Поляков, 2015 http://kpolyakov.spb.ru Новые возможности PascalABC.NET 3 Паскаль сегодня: среды . АЛГО (В. Петрив) Python . Delphi C# • цена ??? • тяжеловесная (4 Гбайт) . Free Pascal • оболочка в стиле 1990-х • по пути Delphi • практически не развивается . PascalABC.NET • поддержка «старого» Паскаля • новые конструкции языка • новые структуры данных (коллекции) • использование библиотек .NET К.Ю. Поляков, 2015 http://kpolyakov.spb.ru Новые возможности PascalABC.NET (версия 3.0) Средства на каждый день К.Ю. Поляков, 2015 http://kpolyakov.spb.ru Новые возможности PascalABC.NET 5 Внутриблочные переменные begin var x: integer = 1; begin Область var y: integer; действия y y := x + 2; writeln(y); end; end. ! Понадобилась переменная – описал! К.Ю. Поляков, 2015 http://kpolyakov.spb.ru Новые возможности PascalABC.NET 6 Внутриблочные переменные в циклах for var i:=1 to 10 do begin writeln(i*i); Область ... действия i end; К.Ю. Поляков, 2015 http://kpolyakov.spb.ru Новые возможности PascalABC.NET 7 Автовывод типов begin var p := 1; // integer var t := 1.234; // real var s := 'Привет!'; // string // чтение с клавиатуры var n := ReadInteger('Введите n:'); var x := ReadReal; ..
    [Show full text]
  • C Programming Tutorial
    C Programming Tutorial C PROGRAMMING TUTORIAL Simply Easy Learning by tutorialspoint.com tutorialspoint.com i COPYRIGHT & DISCLAIMER NOTICE All the content and graphics on this tutorial are the property of tutorialspoint.com. Any content from tutorialspoint.com or this tutorial may not be redistributed or reproduced in any way, shape, or form without the written permission of tutorialspoint.com. Failure to do so is a violation of copyright laws. This tutorial may contain inaccuracies or errors and tutorialspoint provides no guarantee regarding the accuracy of the site or its contents including this tutorial. If you discover that the tutorialspoint.com site or this tutorial content contains some errors, please contact us at [email protected] ii Table of Contents C Language Overview .............................................................. 1 Facts about C ............................................................................................... 1 Why to use C ? ............................................................................................. 2 C Programs .................................................................................................. 2 C Environment Setup ............................................................... 3 Text Editor ................................................................................................... 3 The C Compiler ............................................................................................ 3 Installation on Unix/Linux ............................................................................
    [Show full text]
  • Developing C/C++ Applications with the CDT
    1 Developing C/C++ Applications with the CDT Doug Schaefer QNX Software Systems Eclipse CDT Project Lead Confidential | Date | Other Information, if necessary © 2002 IBM Corporation What is the CDT? Edit/Build/Debug cycle for C and C++ projects Source code editor Build integration with third party build tools Visual debug similar with integration to third party debuggers Source parsing and indexing Drives source navigation features Content assist, Search, Outline © 2006 Doug Schaefer, QNX Software Systems; Made available under the Eclipse Public License v 1.0 2 CDT Edit Perspective Standard JFace Text Editor Keyword highlighting, key bindings Outline View Using internal parser Content Assist Using internal parser and index C/C++ Projects View Showing CDT specific things: includes, binaries Build Console Output © 2006 Doug Schaefer, QNX Software Systems; Made available under the Eclipse Public License v 1.0 3 C/C++ Perspective © 2006 Doug Schaefer, QNX Software Systems; Made available under the Eclipse Public License v 1.0 4 CDT Search Index created on resource change Uses internal parser Searches for declarations, definitions & references Searches for types, variables, functions, macros Search can be invoked from: Search Dialog Context menu on Outline View and C/C++ Project View Action on text selection in editor © 2006 Doug Schaefer, QNX Software Systems; Made available under the Eclipse Public License v 1.0 5 C/C++ Search Dialog © 2006 Doug Schaefer, QNX Software Systems; Made available under the Eclipse Public
    [Show full text]