The NetBSD Project

CVS log for src/usr.bin/xlint/lint1/op.h

[BACK] Up to [cvs.NetBSD.org] / src / usr.bin / xlint / lint1

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.20 / (download) - annotate - [select for diffs], Wed Jun 15 18:29:21 2022 UTC (7 months, 3 weeks ago) by rillig
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10, HEAD
Changes since 1.19: +3 -3 lines
Diff to previous 1.19 (colored)

lint: rename mod_t.m_requires_bool to m_compares_with_zero

The operators NOT, LOGAND, LOGOR and QUEST only require _Bool in strict
bool mode, in default mode they accept any scalar expression and compare
it with zero.  The new names are more accurate.

No functional change.

Revision 1.19 / (download) - annotate - [select for diffs], Sat Apr 16 22:21:10 2022 UTC (9 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.18: +2 -3 lines
Diff to previous 1.18 (colored)

lint: merge mod_t.m_test_context into m_requires_bool

These two flags mean exactly the same.

No functional change.

Revision 1.18 / (download) - annotate - [select for diffs], Sat Apr 16 21:14:33 2022 UTC (9 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.17: +3 -3 lines
Diff to previous 1.17 (colored)

lint: rename members of tnode_t to more closely match reality

The flags do not describe the left operand of the node but both, as for
most operators, either none or both operands are in test context or in
value context.

The one exception is the operator '?' from the '?:' conditional, for
which the left operand is in test context and the right operand is in
value context.

No binary change.

Revision 1.17 / (download) - annotate - [select for diffs], Thu Aug 19 18:39:34 2021 UTC (17 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.16: +7 -6 lines
Diff to previous 1.16 (colored)

lint: un-abbreviate parameter names of macro

Revision 1.16 / (download) - annotate - [select for diffs], Sat Mar 20 20:56:58 2021 UTC (22 months, 2 weeks ago) by rillig
Branch: MAIN
CVS Tags: cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Changes since 1.15: +1 -3 lines
Diff to previous 1.15 (colored)

lint: move getopname over to tree.c

Except for the one use in print_tnode, the name of the operator is only
used in tree.c.

No functional change.

Revision 1.15 / (download) - annotate - [select for diffs], Sat Mar 20 20:39:35 2021 UTC (22 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.14: +3 -5 lines
Diff to previous 1.14 (colored)

lint: remove redundant operator properties table

It's enough to have modtab, which describes the properties of the
various operators.  There is no need to have a second table imods that
holds the same content.  Rather make modtab constant as well.

The only possible functional change is that the names of the internal
operators 'no-op', '++', '--', 'real', 'imag' and 'case' may appear in
diagnostics, where previously lint invoked undefined behavior by passing
a null pointer for a '%s' conversion specifier.

Revision 1.14 / (download) - annotate - [select for diffs], Sat Mar 20 20:15:37 2021 UTC (22 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.13: +7 -3 lines
Diff to previous 1.13 (colored)

lint: fix argument names and table headings for operator definitions

The abbreviations in the table of operator properties had been wrong
since ops.def 1.10 from 2021-01-12, when strict bool mode was added.  In
an earlier working draft, I had named that column 'takes_others' instead
of 'requires_bool', that's where the 'o' came from.

The names of the macro arguments had been wrong since op.h 1.11 from
2021-01-09, when the order of the columns changed and the macros were
not adjusted accordingly.  Since all the properties of the operator
table are uniform, this didn't result in any bugs, it was just confusing
for human readers.

Clang-tidy suggests to enclose the macro arguments in oper.c in
parentheses but that is not possible since the arguments are either
empty or 1, and the syntactical ambiguity of the '+ 0' being either a
unary or a binary operator is needed here.

No change to the resulting binary.

Revision 1.13 / (download) - annotate - [select for diffs], Sun Jan 17 12:23:01 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.12: +22 -22 lines
Diff to previous 1.12 (colored)

lint: rename mod_t members

Revision 1.12 / (download) - annotate - [select for diffs], Tue Jan 12 20:42:01 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.11: +5 -3 lines
Diff to previous 1.11 (colored)

lint: add new check for strict bool mode

In strict bool mode, bool is considered incompatible with all other
scalar types, just as in Java, C#, Pascal.

The controlling expressions in if statements, while loops, for loops and
the '?:' operator must be of type bool.  The logical operators work on
bool instead of int, the bitwise operators accept both integer and bool.
The arithmetic operators don't accept bool.

Since <stdbool.h> implements bool using C preprocessor macros instead of
predefining the identifiers "true" and "false", the integer constants 0
and 1 may be used in all contexts that require a bool expression.
Except from these, no implicit conversion between bool and scalar types
is allowed.

See usr.bin/tests/xlint/lint1/d_c99_bool_strict.c for more details.

The command line option -T has been chosen because all obvious choices
(-b or -B for bool, -s or -S for strict) are already in use.  The -T may
stand for "types are checked strictly".

The default behavior of lint doesn't change.  The strict bool check is
purely optional.

An example program for strict bool mode is usr.bin/make, which has been
using explicit comparisons such as p != NULL, ch != '\0' or n > 0 in
most places for a long time now, even before the refactoring in 2020.

Revision 1.11 / (download) - annotate - [select for diffs], Sat Jan 9 17:36:10 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.10: +3 -3 lines
Diff to previous 1.10 (colored)

lint: reorder table of operator properties

The 4 "requires" properties are now listed together, in descending
strictness.

Revision 1.10 / (download) - annotate - [select for diffs], Tue Jan 5 23:50:29 2021 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.9: +11 -2 lines
Diff to previous 1.9 (colored)

lint: clean up generation of the operator tables

Instead of running a shell program that runs an AWK program that
generates the two files ops.c and ops.h, just define the operator tables
once in ops.def and use these definitions flexibly in ops.c and op.h.

Revision 1.9 / (download) - annotate - [select for diffs], Mon Jan 4 23:58:19 2021 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored)

lint: precedence confusion is only possible with binary operators

No functional change.

The operator table in ops.def states that every operator that has
possibly confusing precedence is also a binary operator, so assert that
instead of having two different code paths.

Revision 1.8 / (download) - annotate - [select for diffs], Sat Jan 2 01:06:15 2021 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.7: +21 -19 lines
Diff to previous 1.7 (colored)

lint: use bool instead of u_int:1 in structures

Better late than never.

Revision 1.7 / (download) - annotate - [select for diffs], Mon Dec 28 19:38:54 2020 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.6: +14 -14 lines
Diff to previous 1.6 (colored)

lint: rename fields in mod_t

Revision 1.4.18.1 / (download) - annotate - [select for diffs], Tue Feb 8 16:20:13 2011 UTC (12 years ago) by bouyer
Branch: bouyer-quota2
Changes since 1.4: +4 -66 lines
Diff to previous 1.4 (colored) next main 1.5 (colored)

Sync with HEAD

Revision 1.6 / (download) - annotate - [select for diffs], Sat Feb 5 17:14:14 2011 UTC (12 years ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-tag8, yamt-pagecache-base9, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, yamt-pagecache, tls-maxphys-base, tls-maxphys, tls-earlyentropy-base, tls-earlyentropy, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, phil-wifi-base, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, phil-wifi, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, pgoyette-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, pgoyette-compat, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb8-mediatek-base, matt-nb8-mediatek, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, localcount-20160914, is-mlppp-base, is-mlppp, cherry-xenmp-base, cherry-xenmp, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan, bouyer-quota2-nbase, bouyer-quota2-base, agc-symver-base, agc-symver
Changes since 1.5: +3 -1 lines
Diff to previous 1.5 (colored)

as promised make the last ops table auto-generated.

Revision 1.5 / (download) - annotate - [select for diffs], Fri Feb 4 23:32:44 2011 UTC (12 years ago) by christos
Branch: MAIN
Changes since 1.4: +2 -66 lines
Diff to previous 1.4 (colored)

generate ops table dynamically. Will move the other table from tree.c there
too.

Revision 1.3.44.1 / (download) - annotate - [select for diffs], Sun May 18 12:36:11 2008 UTC (14 years, 8 months ago) by yamt
Branch: yamt-pf42
Changes since 1.3: +4 -1 lines
Diff to previous 1.3 (colored) next main 1.4 (colored)

sync with head.

Revision 1.4 / (download) - annotate - [select for diffs], Fri Apr 25 22:18:34 2008 UTC (14 years, 9 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, wrstuden-revivesa, netbsd-5-base, netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, netbsd-5, matt-premerge-20091211, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-premerge-20101231, matt-mips64-base2, jym-xensuspend-nbase, jym-xensuspend-base, jym-xensuspend, hpcarm-cleanup-nbase
Branch point for: bouyer-quota2
Changes since 1.3: +4 -1 lines
Diff to previous 1.3 (colored)

preliminary _Complex support.
NB: Does not really understand type conversions between complex and doubles.

Revision 1.3 / (download) - annotate - [select for diffs], Mon Jul 27 13:50:47 1998 UTC (24 years, 6 months ago) by mycroft
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base, wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, wrstuden-devbsize-base, wrstuden-devbsize-19991221, wrstuden-devbsize, netbsd-4-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, netbsd-4, netbsd-3-base, netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0, netbsd-3, netbsd-2-base, netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1, netbsd-2-0-base, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE, netbsd-2-0, netbsd-2, netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001, netbsd-1-6, netbsd-1-5-base, netbsd-1-5-RELEASE, netbsd-1-5-PATCH003, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2, netbsd-1-5, netbsd-1-4-base, netbsd-1-4-RELEASE, netbsd-1-4-PATCH003, netbsd-1-4-PATCH002, netbsd-1-4-PATCH001, netbsd-1-4, minoura-xpg4dl-base, minoura-xpg4dl, matt-mips64-base, matt-mips64, matt-armv6-prevmlocking, matt-armv6-nbase, matt-armv6-base, matt-armv6, keiichi-mipv6-nbase, keiichi-mipv6-base, keiichi-mipv6, hpcarm-cleanup-base, hpcarm-cleanup, fvdl_fs64_base, cube-autoconf-base, cube-autoconf, comdex-fall-1999-base, comdex-fall-1999, chap-midi-nbase, chap-midi-base, chap-midi, abandoned-netbsd-4-base, abandoned-netbsd-4
Branch point for: yamt-pf42
Changes since 1.2: +2 -2 lines
Diff to previous 1.2 (colored)

Fix a recurring typo: comparision -> comparison.

Revision 1.2 / (download) - annotate - [select for diffs], Mon Jul 3 21:24:27 1995 UTC (27 years, 7 months ago) by cgd
Branch: MAIN
CVS Tags: netbsd-1-3-base, netbsd-1-3-RELEASE, netbsd-1-3-PATCH003-CANDIDATE2, netbsd-1-3-PATCH003-CANDIDATE1, netbsd-1-3-PATCH003-CANDIDATE0, netbsd-1-3-PATCH003, netbsd-1-3-PATCH002, netbsd-1-3-PATCH001, netbsd-1-3-BETA, netbsd-1-3, netbsd-1-2-base, netbsd-1-2-RELEASE, netbsd-1-2-PATCH001, netbsd-1-2-BETA, netbsd-1-2, netbsd-1-1-base, netbsd-1-1-RELEASE, netbsd-1-1-PATCH001, netbsd-1-1
Changes since 1.1: +2 -2 lines
Diff to previous 1.1 (colored)

RCS id cleanup

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Mon Jul 3 20:56:37 1995 UTC (27 years, 7 months ago) by cgd
Branch: Jochen_Pohl
CVS Tags: Jochen_Pohl-950703
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

lint(1) implementation, by Jochen Pohl.  named 'xlint' for a similar
reason to why 'install' is named 'xinstall'.

Revision 1.1 / (download) - annotate - [select for diffs], Mon Jul 3 20:56:37 1995 UTC (27 years, 7 months ago) by cgd
Branch: MAIN

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>