📄 read80.txt
字号:
macros it would appear that you can. Define
#define Throws(X) throw X
which then is used as:
float f( float x ) Throws((overflow,underflow))
{ ...
Notice the required double set of parentheses which are needed to
get an arbitrary list of exceptions into a single macro.
When you compile you can define Throws to be null and when you
lint you can define Throws as above. This can be done most
easily by doing a #ifdef on the _lint preprocessor variable
(defined while running our product).
o Function takes Custody flag (ffc)
This flag is normally ON. It signifies that a function will
automatically assume custody of a pointer if the argument is not
of the form const T * where T is some type and is not library.
Turning this flag OFF (with a -ffc) will mean that a given
function will not take custody of a pointer unless explicitly
directed to do so via a custodial semantic for that function and
argument. See option -sem. See also message 429.
o Treat carriage Return as Newline (+frn)
If this flag is ON, carriage return characters (0x0D) in the
source input not followed by a Newline (0x0a) are treated as
Newline characters (i.e., as line breaks). This is necessary to
process Macintosh style source code on the PC or Unix or their
derivatives.
o -A(C90)
The -A option (strict ANSI) has been upgraded to conform to the
C99 standard. In particular it no longer complains about //
comments in C code. To obtain the older style you can use the
option -A(C90) which says that if the module is a C module it
should conform strictly to the version of C identified as C90.
o multi-thread support
A number of customers have asked for some kind of multi-thread
support. In particular they have asked us for a way to designate
some data as 'Shared' so that only functions that are also marked
'Shared' can access the data; also, Shared functions can only
access Shared data and none other. If it were not for the second
criterion you could use the volatile qualifier.
It so happens that there are a number of old modifier flags that
can be used for this purpose. One such is the keyword 'fortran'.
This keyword is normally not active. When it was active
compilers would use the modifier as a clue to employ a
fortran-like calling sequence for any function so designated.
Lint would simply ignore these intended semantics and restrict
its usage to ensuring that declarations would be consistent with
respect to this modifier. For example, you wouldn't want to pass
a pointer that points to a Fortran function to a pointer that
points to a non-fortran function. These simple
type-qualification semantics can be used as the basis for a new
keyword, in this case 'Shared'.
For example:
//lint -rw_asgn(Shared,fortran)
struct X { void f() Shared; void g(); ... };
X Shared a;
X b;
...
a.f(); // OK
a.g(); // Error
b.f(); // Error
b.g(); // OK
Using functions rather than member functions we can obtain the
same effect.
//lint -rw_asgn(Shared,fortran)
struct X { ... };
void f( struct X Shared * );
void g( struct X * );
struct X Shared a;
struct X b;
...
f( &a ); // OK
g( &a ); // Error
f( &b ); // Error
g( &b ); // OK
In addition to 'fortran' there are a number of other old
modifiers that could be employed including: 'pascal',
'_fastcall', and '_loadds'.
Any such modifier that is used in the formation of a type will be
embedded within that type when the type is displayed for
diagnostic purposes. The name that is used by default will be
the original qualification name. This name will be overridden
when the -rw_asgn option assigns a modifier to some new name.
------ New or Improved Error Messages ------
89 Argument or option too long ('String') -- The length of an
option (shown in String) exceeds an internal limit. Please try
to decompose the option into something smaller. At this
writing the limit is 610 characters.
326 String 'String ...' too long, exceeds Integer characters -- A
string (first 40 characters provided in the message) exceeds
some internal limit (provided in the message). There is no
antidote to this condition in the form of an option. FlexeLint
customers may recompile with a redefinition of either M_STRING
(maximum string) or M_NAME (maximum name). To override the
definition in custom.h we suggest recompiling with an
appropriate -dvar=value option assuming your compiler supports
the option.
584 Trigraph sequence (??Character) detected -- This message is
issued whenever a trigraph sequence is detected and the
trigraph processing has been turned off (with a -ftg). If this
is not within a string (or character) constant then the
trigraph sequence is ignored. This is useful if your compiler
does not process trigraph sequences and you want linting to
mirror compilation. Outside of a string we issue the Warning
but we do translate the sequence since it cannot make syntactic
sense in its raw state.
686 Option 'String' is suspicious because of 'Name' -- An option is
considered suspicious for one of a variety of reasons. The
reason is designated by a reason code that is specified by
Name. At this writing, the only reason code is 'unbalanced
quotes'.
1076 Anonymous union assumed to be 'static' -- Anonymous unions need
to be declared static. This is because the names contained
within are considered local to the module in which they are
declared.
1549 Exception thrown for function 'Symbol' not declared to throw --
An exception was thrown (i.e., a throw was detected) within a
function and not within a try block; moreover the function was
declared to throw but the exception thrown was not on the list.
If you provide an exception specification, include all the
exception types you potentially will throw. [23, Item 14]
1550 exception 'Name' thrown by function 'Symbol' is not on
throw-list of function 'Symbol' -- A function was called (first
Symbol) which was declared as potentially throwing an
exception. The call was not made from within a try block and
the function making the call had an exception specification.
Either add the exception to the list, or place the call inside
a try block and catch the throw. [23, Item 14]
1560 Uncaught exception 'Name' not on throw-list of function
'Symbol' -- A direct or indirect throw of the named exception
occurred within a try block and was either not caught by any
handler or was rethrown by the handler. Moreover, the function
has an exception specification and the uncaught exception is
not on the list. Note that a function that fails to declare a
list of thrown exceptions is assumed to potentially throw any
exception.
Gimpel Software
April, 2003
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -