lclint-interest message 187

From Wed Feb 11 12:21:08 1998
Date: Wed, 11 Feb 1998 13:18:56 +0100 (CET)
From: Hermann Kleier <>
Reply-To: Hermann Kleier <>
To: lclint-interest 
Subject: global types in lcl-files
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

N. Wirth is told to have stated that C is a `portable assembler'. C is more.
But one feature a portable assembler should offer is the support for portable
data types.

Example: I need a counter ranging from 0 up to 1000000.  In other words: I need
a 20-bit unsigned counter.  Because I have been writing programs on
different machines (word size: 8, 12, 16, 32, and 60 bit) I am aware of
portability problems  (One of the motivations for using lint's).  I would like
to code:

U20 counter;

This approach is portable.  Unluckily this is not supported by ANSI-C.
Instead ANSI-C offers the file , which can be used to typedef
portable types.  I put the stuff in a global file named "ptypes.h", which I
included in serveral projects over the years.

How can I create types in a .lcl-file that depend on the contents of other


Previous Message Next Message Archive Summary LCLint Home Page David Evans
University of Virginia, Computer Science