Borland BCC32 compiler version 5.6.4 produces the
following warnings when compiling init.c from the CVS.
! Warning W8060 ..\..\..\..\libmss\init.c 85: Possibly
incorrect assignment in function mss_open_logfiles
! Warning W8001 ..\..\..\..\libmss\init.c 142:
Superfluous & with function in function mss_startup
! Warning W8001 ..\..\..\..\libmss\init.c 143:
Superfluous & with function in function mss_startup
! Warning W8001 ..\..\..\..\libmss\init.c 144:
Superfluous & with function in function mss_startup
! Warning W8071 ..\..\..\..\libmss\init.c 152:
Conversion may lose significant digits in function
mss_startup
! Warning W8001 ..\..\..\..\libmss\init.c 161:
Superfluous & with function in function mss_startup
! Warning W8065 ..\..\..\..\libmss\init.c 237: Call to
function 'mss_log_list_blocks_internal' with no
prototype in function mss_exit
Here are the explanations from the Borland Help file:
W8060 Possibly incorrect assignment
This warning is generated when the compiler encounters
an assignment operator as the main operator of a
conditional expression (part of an if, while, or
do-while statement).
This is usually a typographical error for the equality
operator.
If you want to suppress this warning, enclose the
assignment in parentheses and compare the whole thing
to zero explicitly.
For example, this code
if (a = b) ...
should be rewritten as
if ((a = b) != 0) ...
W8001 Superfluous & with function
An address-of operator (&) is not needed with function
name; any such operators are discarded.
W8071 Conversion may lose significant digits
For an assignment operator or some other circumstance,
your source file requires a conversion from a larger
integral data type to a smaller integral data type
where the conversion exists.
Because the integral data type variables don't have the
same size, this kind of conversion might alter the
behavior of a program.
W8065 Call to function 'function' with no prototype
This message is given if the "Prototypes required"
warning is enabled and you call function 'function'
without first giving a prototype for that function.
Logged In: YES
user_id=250965
Warning W8060 ..\..\..\..\libmss\init.c 85: Possibly
incorrect assignment in function mss_open_logfiles
I changed line 85 to
if (!(mss_slogfile = fopen(MSS_SLOG_FILENAME, mode) == NULL))
which makes it similar to line 101 but then got the
additional warning
Warning W8069 ..\..\..\..\libmss\init.c 86: Nonportable
pointer conversion in function mss_open_logfiles
Does that assignment involve dissimilar types?
Warning W8001 ..\..\..\..\libmss\init.c 142: Superfluous &
with function in function mss_startup
Warning W8001 ..\..\..\..\libmss\init.c 143: Superfluous &
with function in function mss_startup
Warning W8001 ..\..\..\..\libmss\init.c 144: Superfluous &
with function in function mss_startup
Changed lines 142, 143 and 144 to
dcflist_create_sorted(&mss_list, mss_free_node_object,
mss_compare_node_objects);
dcflist_create(&mss_scope, mss_free_scope_object);
Warning W8071 ..\..\..\..\libmss\init.c 152: Conversion may
lose significant digits in function mss_startup
This is similar to the warning in log.c (bug report
1157914). Perhaps there is a type mismatch here also.
Warning W8001 ..\..\..\..\libmss\init.c 161: Superfluous &
with function in function mss_startup
I changed line 161 to:
if (atexit(mss_exit) != 0)
Index: init.c
RCS file: /cvsroot/libmss/libmss/init.c,v
retrieving revision 1.10
diff -r1.10 init.c
142,144c142,144
< dcflist_create_sorted(&mss_list,
&mss_free_node_object,
< &mss_compare_node_objects);
< dcflist_create(&mss_scope, &mss_free_scope_object);
---
> dcflist_create_sorted(&mss_list, mss_free_node_object,
> mss_compare_node_objects);
> dcflist_create(&mss_scope, mss_free_scope_object);
161c161
< if (atexit(&mss_exit) != 0)
---
> if (atexit(mss_exit) != 0)