🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #4558

Re: conditional compilation (was C++ vs Modula-2)

#4558
From: John McCalpin
Date: Fri, 13 Jan 1989 14:21
31 lines
2043 bytes
In article <INFO-M2%89011219330825@UCF1VM> <INFO-M2%UCF1VM.bitnet> writes:
>As was recently observed in the info-pascal mailing list, optimization ->
>conditional compilation.  Consider:
>      CONST
>        OpSys = VMS;
>      IF OpSys = VMS THEN
>        DoVMSStuff
>      ELSE
>        DoOtherOSStuff;
>All but the most inanely STUPID of compilers will completely eliminate the
>unreachable code. Anthony L Kimball : alk @ ux.acss.umn.edu / UMNACVX.bitnet

This is only true if the code in Do_VMS_Stuff is *syntactically valid*
on all machines.
Certainly not all machine-specific extensions are compilable on all
systems -- I am thinking of VMS in particular here.  In the Fortran
context, there ain't no way to make most machines compile statements
like
	call LIB$SYS_VMS_SPECIFIC_STUFF (args)
and the optimizers I know of won't remove the dead code unless they
can figure out what it is, since optimization comes long after parsing
and lexical analysis....

In the modula-2 context, I am sure that the machine-specific vector
extensions to the CDC Pascal/Modula-2 compiler (for the Cyber 205 & ETA-10)
are not syntactically valid on other machines....
-- 
----------------------   John D. McCalpin   ------------------------
Dept of Oceanography & Supercomputer Computations Research Institute
mccalpin@masig1.ocean.fsu.edu		mccalpin@nu.cs.fsu.edu
------------------------------------------------------------------
Technical Details
Message-ID: <427@loligo.cc.fsu.edu>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!ames!mailrus!ukma!gatech!gitpyr!loligo!mccalpin
References: <INFO-M2%89011219330825@UCF1VM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!ames!mailrus!ukma!gatech!gitpyr!loligo!mccalpin
From: mccalpin@loligo.cc.fsu.edu (John McCalpin)
Newsgroups: comp.lang.modula2,comp.lang.misc,comp.lang.pascal
Subject: Re: conditional compilation (was C++ vs Modula-2)
Summary: optimization != conditional compilation
Keywords: conditional compilation, optimization
Message-ID: <427@loligo.cc.fsu.edu>
Date: 13 Jan 89 14:21:51 GMT
References: <INFO-M2%89011219330825@UCF1VM>
Reply-To: mccalpin@loligo.UUCP (John McCalpin)
Organization: Supercomputer Computations Research Institute
Lines: 31