Thread View: comp.bugs.2bsd
2 messages
2 total messages
Started by maart
Tue, 06 Sep 1988 00:53
Bug in various lints!
Author: maart
Date: Tue, 06 Sep 1988 00:53
Date: Tue, 06 Sep 1988 00:53
65 lines
1884 bytes
1884 bytes
What does YOUR lint say about the following program?
% cat c.c
main(argc, argv)
int argc;
char **argv;
{
while (*argv != argv[1] && (*argv = argv[1]) && (argc = 0) || (*++argv
&& (**argv && ((++argc)[*argv] && (**argv <= argc[*argv] ||
/*7*/ (**argv += argc[*argv] -= **argv = argc[*argv] - **argv)) &&
--argv || putchar(**argv) && ++*argv--) || putchar(10))))
;
}
%
Sun3 with Sun UNIX 4.2 Release 3.5:
% /usr/bin/lint -abchpx c.c
%
Sun4 with SunOS Release Sys4-3.2:
% /usr/bin/lint -abchpx c.c
lint: Option -p not recognized
% ^p^
/usr/bin/lint -abchx c.c
%
On our other sun4 (same OS) the response was:
lint: Fatal error in lint2: Bus error (core dumped)
VAX11/750 with 4.3 BSD UNIX:
% /usr/bin/lint -abchpx c.c
%
PDP11/44 with 2.9BSD:
% /usr/bin/lint -abchpx c.c
%
Mantra m68000 with Sys5 V3:
% /usr/bin/lint -abchpx c.c
c.c
==============
(10) warning: main() returns random value to invocation environment
==============
name used but not defined
putcha c.c(8)
%
Whereas the output should be something like:
c.c(7): warning: evaluation order undefined
The only lint to catch this was ACK (The Amsterdam Compiler Kit) lint (not
generally available right now, I've been told).
(Yes, c.c was a winning entry in the IOCCC and I was very satisfied that lint
didn't complain about it... What would it do?)
Thanks to Leendert van Doorn, Ceriel Jacobs and Dick Grune for pointing out
the bug.
Re: Bug in various lints!
Author: Maarten Litmaath
Date: Tue, 06 Sep 1988 16:07
Date: Tue, 06 Sep 1988 16:07
9 lines
806 bytes
806 bytes
In article <1344@solo12.cs.vu.nl> maart@cs.vu.nl (Maarten Litmaath) writes:
\Mantra m68000 with Sys5 V3:
\
\ % /usr/bin/lint -abchpx c.c
^^^^^^
That should have been only '-p', of course, due to those nice Sys5 semantics.
--
Alles klar, |Maarten Litmaath @ Free U Amsterdam:
Herr Kommissar? |maart@cs.vu.nl, mcvax!botter!maart
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads