PL/I Constructs 2018-03-14T16:26:49+00:00

Detecting and reporting unlikely constructs

PL/I is a versatile language, where the level of ambiguity is such that actual bugs may go unnoticed because the compiler accepts the input, in a way that is totally different from what the developer had intended to do.

For instance, a piece of code such as:

dcl aa fixed bin(15), init(7);

declares a variable named INIT as an array of 7 elements while the developer’s original intention clearly was to define 7 as the AA variable’s initial value. The comma – erroneously – placed before the INIT clause causes the compiler to understand it as a separate variable declaration.

Such unlikely constructs, as well as many others, are detected and duly reported by the Raincode PL/I compiler:

  • Implicit variable declarations

  • Initialization clauses with more values than elements to fill

  • Missing END keywords in nested statements

  • INIT clauses in based variables (which are ignored)

  • Implicit promotions from bit strings to floating point values, which induce probable differences in precision

Each of these warnings can be deactivated to avoid clobbering the compiler output, or forced into plain errors when you want to ensure that no program will be compiled if it contains similar instances of disorderly programming.

This website stores some user agent data. These data are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to opt-out of any future tracking, a cookie will be set up in your browser to remember this choice for one year. I Agree, Deny
614