Sami Vaarala
be88ba143c
Use helper for FP comparisons, use -Wfloat-equal
Direct comparison may have portability concerns because a constant may
have more precision than its counterpart. Even a direct cast before
a comparison may not work (e.g. Math.atan2() assert with gcc -m32 still
fails even when both sides have an explicit double cast). So use an
internal always-inline helper for float/double comparisons, which also
allows -Wfloat-equal warning to be suppressed in a single helper; add
a clang pragma option so that both gcc and clang suppress the warning.
Other changes:
* Add -Wfloat-equal warning back to the Makefile.
* Fix all internal float comparison call sites to use the helper.
* Add code policy check for probable floating point comparison
(not very important with -Wfloat-equal enabled).
5 years ago
Sami Vaarala
2248de822b
Code policy fix for duk_util.h
7 years ago
Sami Vaarala
f91d17526b
Add plain DUK_MEMXXX() to code policy check
7 years ago
Sami Vaarala
d6307f778c
Add duk_context check to code policy
7 years ago
Sami Vaarala
2875c32b8f
Add codepolicycheck for longlong consts
8 years ago
Sami Vaarala
04411af116
Add #ifdef and #ifndef checks to codepolicy
8 years ago
Bruce Pascoe
3474ccf54f
Add Math.cbrt() built-in function
8 years ago
Sami Vaarala
af40cd2edd
Makefile, dist, tools fixes for src/ rename
8 years ago
Sami Vaarala
5691f5e344
Python tool cleanups and improvements
Various fixes, verbosity reduction, etc.
8 years ago
Sami Vaarala
9e8f16c43e
Split dist util, reorg tools, Python PEP8
8 years ago
Sami Vaarala
5ffba13a14
Add 'index' and related to rejected identifiers
9 years ago
jaseg
6715fa1640
Make things work on systems defaulting to python3
9 years ago
Sami Vaarala
3a959223c2
Fix codepolicycheck boolean option handling
9 years ago
Sami Vaarala
60ebbdb830
Add --fail-on-errors to code policy checker
9 years ago
Sami Vaarala
e04a1209eb
Add --check-cpp-comment code policy check option
9 years ago
Sami Vaarala
332ae46237
Add code policy checker options
9 years ago
Sami Vaarala
9509fd1af5
Code policy checker fix
9 years ago
Sami Vaarala
fc55a592bd
Misc genconfig changes: Makefile, README, dist
9 years ago
Sami Vaarala
bb57e4f94f
Fix code policy check for empty strings
10 years ago
Sami Vaarala
b9cd6408a8
Detect non-leading tabs
Tabs are only used for indent and should not be used elsewhere in source.
Otherwise the source won't look correct with different tab widths.
10 years ago
Sami Vaarala
c0c5458ec4
Add symbol visibility checks to code policy util
This required some awkward changes because the symbol visibility check needs
access to the previous line in some cases.
10 years ago
Sami Vaarala
1ac5403938
Add non-ascii check to code policy
10 years ago
Sami Vaarala
687830e27a
Code policy improvements
- Better linenumber for policy complaint
- Add empty first line check to code policy checker
10 years ago
Sami Vaarala
ccc4f2d869
Code policy check for file last line
Don't allow empty trailing lines nor missing newline from end of file.
10 years ago
Sami Vaarala
a97eb18a3c
Code policy tool improvements
- Detect plain identifiers (e.g. 'fpclassify')
- Strip comments and literals for some checks
- Strip expect strings for API testcase checks
10 years ago
Sami Vaarala
ff3db386e7
Add --dump-vim-command option for code policy
Also exclude a few debug log macro call sites which are incorrectly
reported as problems.
10 years ago
Sami Vaarala
19629ec8dd
Add FIXME policy check
10 years ago
Sami Vaarala
f48025a98e
Extend debuglog checker with more policy checks
Check for: mixed indent, carriage returns, trailing whitespace, and the
previous debug log form.
10 years ago