Thread View: net.lang.c
2 messages
2 total messages
Started by Paul Schauble
Mon, 20 Oct 1986 02:54
Structures as arguments, lint checking
Author: Paul Schauble
Date: Mon, 20 Oct 1986 02:54
Date: Mon, 20 Oct 1986 02:54
19 lines
948 bytes
948 bytes
I was recently suprised to discover that Microsoft C and two different
lints all pass without complaint the sequence
struct sa { definition a} a;
struct sb { definition b} b;
void sub(x)
struct sa *x;
{....
}
sub(&b);
Is there something I don't know about that causes & to lose the
information as to the type of structure? Or does everyone happen to have
the same bug?
Paul
Schauble at MIT-Multics
Re: Structures as arguments, lint checking
Author: Wayne Throop
Date: Thu, 23 Oct 1986 18:07
Date: Thu, 23 Oct 1986 18:07
22 lines
1396 bytes
1396 bytes
> Schauble@MIT-MULTICS.ARPA (Paul Schauble)
> I was recently suprised to discover that Microsoft C and two different
> lints all pass without complaint the sequence
> struct sa { int a; } a;
> struct sb { int b; } b;
> void sub(x) struct sa *x; {}
> void main(){sub(&b);}
(I've made minor edits to the example to turn it into a lint-able unit.)
Our SysV.2 lint catches this problem, complaining of "argument used
inconsistently". Our compiler does not complain, but then most
compilers don't complain about such things. Which two lints didn't
catch it? This seems a very odd thing for any lint to miss.
--
Old computers go into computer museums,
but old software goes into production.
--- Eric Bush
--
Wayne Throop <the-known-world>!mcnc!rti-sel!dg_rtp!throopw
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