lclint-interest message 186

From Wed Feb 11 12:09:56 1998
Date: Wed, 11 Feb 1998 15:07:50 +0100 (CET)
From: Hermann Kleier <>
Reply-To: Hermann Kleier <>
To: lclint-interest 
Cc: Alias of hermann for sending emails <>
Subject: Constants in .lcl-files
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

I used to have the following four definitions/declarations in a header file:

#define FAR
#define RECORDSIZE 925
typedef char FAR Inrecord [RECORDSIZE];
typedef const char FAR *ConstString;

The data types defined are used as function parameters.  Therefore I need to
move the declarations to my .lcl-file.   But then the problems occurr:

(1) FAR:           Just a macro defined to an emty string for reasonable
                   operating systems. But some environments need to define `FAR'
                   as `far'.

(2) const:         Simply yields a parse error.  I know, the /*@*/ can guarantee
                   that a function does not alter its parameters.  But a const
                   data type is recognized by any ANSI-C compiler.

(3) RECORDSIZE:    I dislike to seed my constants around in the program.  I
                   prefer macros or int constants.

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