PL/I Unlikely constructs

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);PL/I unlikely constructs Raincode

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:

  1. Implicit variable declarations
  2. Initialization clauses with more values than elements to fill
  3. Missing END keywords in nested statements
  4. INIT clauses in based variables (which are ignored)
  5. 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.

Sign in
Forgot password?
Sign up

(*) Required fields

I agree with Raincode Terms & Privacy Policy