Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src



Module Name:    src
Committed By:   rillig
Date:           Thu Feb  4 06:55:00 UTC 2021

Modified Files:
        src/tests/usr.bin/xlint/lint1: d_constant_conv2.exp d_gcc_extension.exp
            d_type_conv1.exp d_type_conv2.exp d_type_conv3.exp msg_259.c
            msg_259.exp
        src/usr.bin/xlint/lint1: err.c tree.c

Log Message:
lint: add back "due to prototype" to message 259

That message is only supposed to warn about compatibility to traditional
C, in case the function should ever be compiled without its prototype
being in effect.  All other type checks are supposed to be in another
function, as documented, but that type check misses to report a few
error-prone type combinations (long to char, long to int).

30 years after the introduction of prototypes with C90, almost all
existing code uses prototypes.  The warning has thus lost most of its
usefulness and can rather be confusing since a conversion from 'char' to
'long' is not problematic with prototypes in action, and the probability
of the code being backported to a pre-C90 compiler is diminishingly
small.

The words "due to prototype" now serve as a hint again.  The proper fix
could be to suppress this warning in C99 mode since that's far enough
from traditional C.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/d_constant_conv2.exp \
    src/tests/usr.bin/xlint/lint1/d_type_conv1.exp \
    src/tests/usr.bin/xlint/lint1/d_type_conv2.exp \
    src/tests/usr.bin/xlint/lint1/d_type_conv3.exp \
    src/tests/usr.bin/xlint/lint1/msg_259.c \
    src/tests/usr.bin/xlint/lint1/msg_259.exp
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/d_gcc_extension.exp
cvs rdiff -u -r1.77 -r1.78 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.204 -r1.205 src/usr.bin/xlint/lint1/tree.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index