🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.sys5
Article #931

bug in lint with void (*f)()

#931
From: Steve Losen
Date: Fri, 16 Dec 1988 22:39
36 lines
1221 bytes
Sorry if this has already been reported...

Lint on an AT&T 3b2 running SysV r3.0 behaves inconsistently
on this program:

=========================
void a()
{
        printf("a\n");
}

void b()
{
        printf("b\n");
}

main()
{
        void (*emit)();
        int i = 1;

        if (i) emit = a; else emit = b;  /* lint buys this */

        emit = i ? a : b;  /* lint rejects this */

        (*emit)();
        return(0);
}
==========================

Evidently lint does not like the combination of the void type and
the ?: operator.  Lint works fine if I declare everything "int"
instead of "void".  Anyone have a fix?
-- 
Steve Losen     scl@virginia.edu
University of Virginia Academic Computing Center
Technical Details
Message-ID: <1450@virginia.acc.virginia.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!cwjcc!hal!nic.MR.NET!tank!mimsy!haven!uvaarpa!virginia!scl

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!cwjcc!hal!nic.MR.NET!tank!mimsy!haven!uvaarpa!virginia!scl
From: scl@virginia.acc.virginia.edu (Steve Losen)
Newsgroups: comp.bugs.sys5
Subject: bug in lint with void (*f)()
Message-ID: <1450@virginia.acc.virginia.edu>
Date: 16 Dec 88 22:39:51 GMT
Reply-To: scl@virginia.acc.Virginia.EDU.acc.virginia.edu (Stephen C. Losen)
Organization: Academic Computing Center, University of Va.
Lines: 36