🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: mod.computers.masscomp
Article #38

Bug using sizeof in cc (SP-2850) 1.1

#38
From: dhb
Date: Mon, 18 Aug 1986 04:02
24 lines
1061 bytes
I ran across a bug using sizeof with an expression when the expression
is a typedefed variable of an array type.  The following program illustrates
the problem:

typedef int	BITMAP[4];

main ()

{
    BITMAP	map;

    printf("sizeof (BITMAP) = %d\n", sizeof (BITMAP));
    printf("sizeof (map) = %d\n", sizeof (map));
}

results in the output

    sizeof (BITMAP) = 16
    sizeof (map) = 4

I have sent in an SQR on the problem.

Dave Bilitch		{ topaz | seismo }!cit-vax!bek-mc!dhb
CALTECH
Technical Details
Message-ID: <1052@soma.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!decvax!decwrl!ucbvax!ucbcad!nike!caip!clyde!cbatt!cbosgd!soma!bek-mc!dhb

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!decvax!decwrl!ucbvax!ucbcad!nike!caip!clyde!cbatt!cbosgd!soma!bek-mc!dhb
From: dhb@bek-mc.UUCP
Newsgroups: mod.computers.masscomp
Subject: Bug using sizeof in cc (SP-2850) 1.1
Message-ID: <1052@soma.UUCP>
Date: Mon, 18-Aug-86 00:02:56 EDT
Article-I.D.: soma.1052
Posted: Mon Aug 18 00:02:56 1986
Date-Received: Mon, 18-Aug-86 23:16:55 EDT
Sender: masscomp@soma.UUCP
Organization: Masscomp Users' Society
Lines: 24
Keywords: cc SP-2850
Approved: masscomp@soma.uucp