Impact of suppressing some compiler diagnostics
John E. Malmberg
wb8tyw at qsl.net
Sun Sep 26 04:57:24 GMT 2004
As these messages are being suppressed in last release of SAMBA 2.2.8,
it is probably useful to indicate what the impacts of suppressing them are.
With a program as complex as SAMBA, if any of these are causing a
problem, it may be difficult to notice in all cases.
I am still trying to get all the changes done that will allow SAMBA
2.2.8 to compile and run on OpenVMS 8.2 with out most of these messages
suppressed.
The questcompare1 messages are showing definite bugs that so far have
not been traced to any issues I have seen posted on the SAMBA_VMS
mailing list.
-John
wb8tyw at qsl.network
Personal Opinion Only
CVTDIFTYPES
This indicates a data conversion is being requested that
is not defined according to standard C. While the HP C
compiler will usually guess right on the conversion, this
code is not portable, nor can it be guaranteed that the
conversion will be correct.
As it is a non-standard conversion, any changes in the
code or build environment can change the result.
Usually this means a programming error.
Many times it means a missing cast, but other times
it means that a variable is defined differently than
what it is used for.
This message should almost never need to be suppressed.
DUPEXTERN
This means that two externally visible symbols have the
same name. This should never happen and is an indication
of a programming error.
EXPRNOTUSED
This indicates that an expression is not used. It's presence
usually indicates a programming error. The most common is
that a "==" was used instead of an assignment.
It sometimes means that a macro to inhibit some function
was not coded in a way that would not cause the message.
This is a high indication of a bug.
IMPLICITFUNC
The compiler does not have a definition for this function,
and is falling back on the old C definition of the function.
It is a violation of the C standard for any function that
takes a variable number of parameters to be implicitly
defined. And on several platforms, the C compiler will
generate the wrong code for such functions if it does
not detect the error.
All known versions of HP C on VMS will always generate
the correct code in this case for the varying number of
calling parameters, but the prefix for the external
function may be incorrect for options of the the module
being compiled.
This should be considered a bug as it should be trivial
to correct.
INPTRTYPE
This is a detected illegal type conversion. Data corruption
is possible. High probability of a programming error.
Many times it means a missing cast, but other times it
means that a variable is defined.
This message should never need to be suppressed.
INTCONCASTTRU
This means that the program is trying to put a constant
value into a data cell that is too small and trying to
use a cast to do a type conversion.
High probability of a programming error.
This usually indicates that a variable is declared
differently than it is actually used, or a mask is
missing to manually truncate the significant bits of
the data is missing.
This message should almost never need to be suppressed.
INTCONSTTRUNC
This means that the program is trying to put a constant
value into a data cell that is too small for it.
High probability of a programming error.
This usually indicates that a variable is declared
differently than it is actually used, or a mask is
to manually truncate the significant bits of the data
is missing.
This message should almost never need to be suppressed.
MACROREDEF
A macro is being unexpectedly reassigned. This can be
by design, or can indicate a programming error, usually
indicating an inconsistency in the order that header
files are included.
I usually find this to be from a programming error where
the wrong macro definition is being used in some parts of
a program.
As this problem can usually be easily fixed, this
message should rarely need to be suppressed.
MIXLINKAGE
A symbol is declared as both internal and external in
the same scope. That means that the compiler can not
know what to do, and is guessing. It can not be
predicted if the HP or any other compiler is doing the
right thing.
This is usually a programming error.
This message should never need to be suppressed.
NESTEDCOMMENT
This usually indicates that a section of code is
accidentally being commented out.
In the case of SAMBA 2.2.8, there is one case that
there is a minor bug in the SMG$ header files. I
will be filing a bug report for that to be fixed in
a future release.
For user written code it is probably better to fix
the code than to suppress this message and risk an
unterminated comment affecting a large block of code.
NOTCONSTQUAL
This indicates that you are potentially allowing the
modification of data that the compiler has been told
is not supposed to be modified.
Suppression of this message can result in data corruption
and improper operation of the program.
The big risk is that a module that calls a module that
is displaying this diagnostic will be assuming that the
data was not modified. And is not likely to always use
the modified data.
About the only place a cast is legitimately needed to
to suppress this message is when a (const * char) needs
to be assigned to a dsc$a_pointer, and a pointer to that
structure will be passed to a VMS routine as a read only
parameter.
All other occurrences should be examined carefully as they
are likely a critical bug.
PROTOSCOPE
There is an error in a function prototype where it is
referencing a type that has not yet been defined.
This indicates a bug in the header definitions, or
the order that header files are defined.
The HP C Compiler on VMS will still generate the correct
code.
On other platorms the C compiler will not have the
the information needed to generate the correct code.
This bug should always be trivial to fix, so this message
should never need being suppressed.
RIGHTSHIFTOVR
The compiler has detected that the resulting expression
is going to always result in 0 for an unsigned result, or
0 or 1 for a signed result.
This usually is the result of a programming error.
This message should almost never need being suppressed.
NONSTANDCAST
The cast used to assign a symbol to a function pointer is
illegal. HP C on VMS will do the expected thing here.
Such code is not portable, and is present in the UNIX
SAMBA code.
Suppressing this message is a quick way to get the
compile done, but this really is an indication of a bug.
I have not yet determined the way to recode these
sections of SAMBA to be compliant with the C standard.
NOPARMLIST
Declaring a prototype or a function with no parameters
is now strongly discouraged.
Declaring a prototype this way for a function with
a varying number of parameters is illegal by the
C standard.
The HP C compiler on VMS will generate the expected
code. Other C compilers on other platforms will not
when the function has a varying number of parameters.
As this is trivial to fix, this message should never
need to be suppressed.
OUTTYPELEN
An illegal output conversion has been requested and
detected at compile time. The resulting data may
be formatted incorrectly.
This is usually a programming error.
This message should almost never need to be suppressed.
PTRMISMATCH
An incompatable pointer conversion is being requested.
This usually indicates a minor programming error,
usually in a function prototype where a data type is
being declared in a mannor contray to it's use.
This message should almost never need to be suppressed.
PTRMISMATCH1
An incompatable pointer conversion is being requested,
where the mismatch is between a signed and unsigned
data type.
This usually indicates a programming error that can
result incorrect program operation with comparison
operations. Usually a prototype or variable is
not declared according to it's use.
This message should almost never need to be suppressed.
QUESTCOMPARE1
This indicates that an unsigned value is being tested
to see if it is less than zero. This of course can
never happen.
This indicates a programming bug.
Several occurrences of this are found in what appears
to be the UNIX code base, mostly involving the time_t
data type. It needs to be verified if this bug is
present in the current UNIX releases and the proper
BUGZILLA reports filed.
The impact of these compiler detected bugs is still
unknown. The compiler is clearly not generating the
intended code in almost all of the cases discovered
so far.
Suppressing this message will usually leave serious
programming bugs undetected.
More information about the samba-vms
mailing list