Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.databases.pick > #2356
| Path | csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!peer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!Xl.tags.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.posted.internetamerica!news.posted.internetamerica.POSTED!not-for-mail |
|---|---|
| NNTP-Posting-Date | Fri, 31 Jul 2015 14:08:24 -0500 |
| From | "Frank Winans" <fwinans@sbcglobal.net> |
| Newsgroups | comp.databases.pick |
| Subject | maybe need a lint checker application program to preen basic programs? |
| Date | Fri, 31 Jul 2015 14:08:18 -0500 |
| MIME-Version | 1.0 |
| Content-Type | text/plain; format=flowed; charset="iso-8859-1"; reply-type=original |
| Content-Transfer-Encoding | 7bit |
| X-Priority | 3 |
| X-MSMail-Priority | Normal |
| X-Newsreader | Microsoft Windows Mail 6.0.6002.18197 |
| X-MimeOLE | Produced By Microsoft MimeOLE V6.1.7600.16385 |
| Message-ID | <Ca2dnUtc_sg0WibInZ2dnUU7-QmdnZ2d@posted.internetamerica> (permalink) |
| Lines | 48 |
| X-Usenet-Provider | http://www.giganews.com |
| NNTP-Posting-Host | 24.112.21.216 |
| X-Trace | sv3-hAY18POArXCTT4icHQtV/bgO77XVeVABCg0qx3g3+EV7NUaMFwcsY7jn94SAsJwbrUHXfU/lTSLRvOR!WJh+tYTDp4Igm6oArIuxWXEGtDj608CR/HrxGaJZwe+GCb8yGhzOnCNRJlg/jdCDwTZTRzaeXVW2!+pTKwsQv8TLjxWHS+cnNYptKFsH7cQzWlmdlGGUkFr1e |
| X-Complaints-To | abuse@airmail.net |
| X-DMCA-Complaints-To | abuse@airmail.net |
| X-Abuse-and-DMCA-Info | Please be sure to forward a copy of ALL headers |
| X-Abuse-and-DMCA-Info | Otherwise we will be unable to process your complaint properly |
| X-Postfilter | 1.3.40 |
| X-Original-Bytes | 3573 |
| X-Received-Bytes | 3685 |
| X-Received-Body-CRC | 2055737160 |
| Xref | csiph.com comp.databases.pick:2356 |
Show key headers only | View raw
Not all bad program code gets caught at compile time;
but a really really comprehensive error checker would bog down the compiler badly.
A middle ground might be a un*x-like 'lint' program that one could run on their
production software source code as a final paranoid check, even if it runs all night.
Here's an example bad program that compiles cleanly
01 * {I know nnnEnn and nnnFnn are scientific notation constants in some
02 * other languages, but don't think they are part of basic}
03 * But they generally won't be noticed as bad syntax at compile time...
04 *
05 * Variable names are assumed to start with a letter;
06 * numbers found before first variable on a line are assumed to be a
07 * program label number, even without any ":" or space after the 'label'.
08 *
09 1E3 = 6 ;* compiler treats this as 1: E3 = 6 (that is, 1 is a label number)
10 crt 'e3 is ':E3 ;* sez e3 is 6
11 *
12 * alphabetic text after a numeric constant is presumed to be a mask expr
13 * though I'm not sure what 'E3 + 4' is supposed to mean in real life...
14 crt 1E3 + 4 ;* sez 10000.0
15 crt 2E3 ;* sez 2.000000
16 goto 7 ;* proves 7frog below is parsed as if it were 7: frog = 42
17 crt 'dead code' ;* does not get executed
18 7frog = 42
19 crt 'frog is ':frog ;* sez frog is 42
20 stop
21 end
What features are worth putting in such a 'lint' program is highly debatable, but perhaps;
(imperfectly, I'm sure) find variables that are used before being set,
(many basics give error msgs about that, but only at run time)
variables set but never used {so that name was probably mis-typed by author}
numeric labels with neither space nor ":" after them
suspicious-looking mask expressions {author left out an intended '+'
operator}
and that is a very broad term, 'suspicious', hence elicits a huge
block of
program logic. Maybe just log a warning if that form not used in any
other
certified-ok production programs in the same account, or if involves
a
non-trivial variable name that is also used in a non-masking role in
same prog?
Back to comp.databases.pick | Previous | Next | Find similar
maybe need a lint checker application program to preen basic programs? "Frank Winans" <fwinans@sbcglobal.net> - 2015-07-31 14:08 -0500
csiph-web