From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,dcc787a7dc2bc291 X-Google-Attributes: gidfee84,public X-Google-Thread: f678f,dcc787a7dc2bc291 X-Google-Attributes: gidf678f,public From: John Parks Subject: Re: PGP 5.0i compile problem - LOCATED Date: 1999/01/20 Message-ID: <36A5F92C.C6EC07@zko.dec.com>#1/1 X-Deja-AN: 434845705 Content-Transfer-Encoding: 7bit References: <36A4749D.37F4F8D4@ev.co.yu> <783k9b$d73$1@news.latrobe.edu.au> <784l4f$i2r$1@news.uk0.vbc.net> Content-Type: text/plain; charset=us-ascii Organization: Digital Equipment Corporation Mime-Version: 1.0 Newsgroups: comp.unix.osf.osf1,comp.unix.osf.misc Nikola Milutinovic wrote: >> I'm not sure what the standard says about CPP directives. I remember >> reading that NewLines, Tabs and Spaces are treated as WhiteSpace and >> that you can write the whole program in a single line, if you like. >> Well, not with Digital, apparently. This problem is totaly the "feature" >> of cpp. The ANSI standard says that cpp directives can begin in any column -- so long as the initiating # is the first non-whitespace character on the line. Indentation is cool then -- so long as you preprocess the input in an ANSI-compliant cpp mode. Those modes include -std and -std1 but NOT -std0 which is the default. >> This problem is totaly the "feature" of cpp. Right. -std0 mode is "K&R compatibility" mode and Kernighan and Ritchie insisted that cpp directives begin in column 1. One could argue that the K&R behavior is a feature, not a bug. It allows for faster preprocessing than the ANSI model (since the cpp can do a fast scan down column 1 rather than have to consider whitespace). It also improves the cpp's ability to preprocess general text input (fortran, makefiles, etc.) since #'s that aren't in column 1 are not an issue. >> Since this feature of cpp persists in both 3.2 and in 4.0 versions, it >> is highly unlikely we'll see it changed. Right. Too many users rely on the K&R behavior to change it. >> Any feedback, sugestions and advice is welcome. Sure. Add -std to your command-line. That'll change modes from "K&R" to "relaxed ANSI" and your code work without modification. Hope this helps. \John Parks (Digital UNIX cpp author)