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:           Tue Nov 16 21:01:06 UTC 2021

Modified Files:
        src/tests/usr.bin/xlint/lint1: d_c99_bool_strict.c
            d_c99_bool_strict.exp
        src/usr.bin/xlint/lint1: cgram.y ckbool.c debug.c externs1.h func.c
            init.c lint1.h mem1.c tree.c

Log Message:
lint: fix check for function calls in strict bool mode

Previously, if a function call occurred in the controlling expression,
its return type could be any scalar, not just bool.  This was against
the goal of strict bool mode, which makes bool a separate and
incompabile type to all other types.  For example, it would allow
controlling expressions like 'strcmp(a, b)' without the usual '!= 0',
but only if at least one of 'a' and 'b' came from a macro definition
from a system header.

The fix is that the decision of whether the type of the controlling
expression may be scalar is no longer based on the operand types but on
the main operator of the controlling expression.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c
cvs rdiff -u -r1.31 -r1.32 \
    src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.exp
cvs rdiff -u -r1.369 -r1.370 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/xlint/lint1/ckbool.c
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/xlint/lint1/debug.c
cvs rdiff -u -r1.139 -r1.140 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.125 -r1.126 src/usr.bin/xlint/lint1/func.c
cvs rdiff -u -r1.209 -r1.210 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.130 -r1.131 src/usr.bin/xlint/lint1/lint1.h
cvs rdiff -u -r1.54 -r1.55 src/usr.bin/xlint/lint1/mem1.c
cvs rdiff -u -r1.394 -r1.395 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