🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.bugs.v7
Article #15

sizeof type botch

#15
From: utzoohenry
Date: Mon, 04 Jan 1982 19:16
18 lines
637 bytes
The following program displays a bug in the V7 C compiler.  Whether this
should be fixed by revising the documentation or changing the code is a
good question.

/*
 * sizeof is supposed to be semantically an integer constant.  It's not,
 * in the V7 compiler:  its type is always "unsigned", which an integer
 * constant never is.
 */

#define	BIG	20000	/* 40000 / sizeof(int) */

int foo[BIG];

main()
{
	printf("%D == %D (!)\n", 40000, sizeof(foo));
}
Technical Details
Message-ID: <anews.Autzoo.1248>
Path: arc1-ca.pugleaf.net!utzoo!henry

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!henry
From: utzoo!henry
Newsgroups: net.bugs.v7
Subject: sizeof type botch
Date: Mon, 04 Jan 1982 19:16:17 +0000
Message-ID: <anews.Autzoo.1248>