Commit graph

1537 commits

Author SHA1 Message Date
gitlost
7a1500afeb backend/CMakeLists.txt: output dir for zintconfig.h, props Andre Maute (#238); copyright/guard 2021-07-12 16:57:32 +01:00
gitlost
d7d787383e backend/tests/CMakeLists.txt: cmake min 3.18 -> 3.9, bwipp_dump.ps tar (#235) 2021-07-08 12:08:59 +01:00
b'Git Lost
3046690d98 Merge /u/gitlost/zint/ branch changelog into master
https://sourceforge.net/p/zint/code/merge-requests/126/
2021-07-07 21:55:23 +00:00
gitlost
e1f22e0e72 CODE128: make cppcheck out-of-bounds suppression clearer (#233), props Andre Maute 2021-07-07 15:46:02 +01:00
gitlost
4d9aa96453 testUtilDataPath: use CMAKE_CURRENT_SOURCE_DIR env to work out-of-tree (#234) 2021-07-07 14:47:25 +01:00
gitlost
7379acd4a4 backend/tests/CMakeLists.txt: fix bwipp_dump.ps tar (#235), props Alonso Schaich, Andre Maute 2021-07-07 14:42:16 +01:00
gitlost
f03da2f4ba CODE128: suppress cppcheck out-of-bounds warning; plus others (#233) 2021-07-07 13:58:04 +01:00
gitlost
37cb277397 Move project history/version from manual.txt, backend/README into new ChangeLog 2021-07-07 10:46:26 +01:00
atom
3e995c70fb Simpily CMakeLists 2021-07-07 12:39:21 +03:00
gitlost
3c1869b032 library: compat symbology 39 fix; ISBN: "X" check
WARN_FAIL_ALL: always return error: ZINT_ERROR_USES_ECI/NON_COMPLIANT
Fuller error messages; more comments zint.h
mainwindow.cpp: replace metaobject ENUM with array
  (suppresses virtual in constructor warning)
2021-07-06 19:53:31 +01:00
gitlost
7cd0d9ae22 CODABLOCKF: suppress cppcheck warning (#233) 2021-07-06 17:21:42 +01:00
gitlost
4d3aae45d0 testcommon: fix sizeof bug; AZTEC/QR: suppress cppcheck warnings (#233) 2021-07-06 12:13:34 +01:00
gitlost
9b02cd5221 CODEONE: is_last_single_ascii() out-of-bounds sp + 1, #232 CI-Fuzz, props Jan Schrewe 2021-07-05 11:52:43 +01:00
gitlost
bcf6eff93c testUtilDataPath: fix running from build subdir (#230) 2021-07-02 16:13:48 +01:00
gitlost
a312cd8e8e raster/output: use new isfintf() to test floats integral (CodeQL) 2021-06-30 11:57:21 +01:00
gitlost
37fac73cb1 DATAMATRIX/CODEONE: Use LCM in look ahead tests to avoid floats (#228) 2021-06-29 22:02:24 +01:00
gitlost
368633bda4 malloc/calloc: check for NULL always (11.1.0 gcc -fanalyzer -c backend/*.c)
ZBarcode_Encode: don't reinit symbol->outfile, props Alonso Schaich
frontend/test_args: skip long filename tests on Windows, props Alonso Schaich
2021-06-29 15:43:42 +01:00
gitlost
8c419ab4fb DATAMATRIX/DBAR_LTD: some hacks to get around MSVC 2015/2019 x64 optimizer bugs 2021-06-27 15:58:27 +01:00
gitlost
52c00e59ba C25/DBAR: use new func gs1_check_digit() for common GS1 check digit calc
CODE11/CODE39/EXCODE39/CODE93/PZN/CHANNEL/VIN/DBAR/UPCEAN: fuller error messages
DATAMATRIX: look_ahead_test debug counts
DBAR: consolidate option_2 cols_per_row
CMakeLists.txt: restore -fno-var-tracking-assignments for gcc no DEBUG
overall: suppress various warnings on various configs
testcommon.c: clean-up
2021-06-27 11:47:55 +01:00
gitlost
33ebcea30c Disable ZINT_SANITIZE for MSVC for now; use RESULT_VAR (MR #124, commit [ee3f25]) 2021-06-26 00:50:56 +01:00
gitlost
542fed1d4f DATAMATRIX: strip extra precision in loop also (#228); AZTEC: move assert after error check (#229) 2021-06-26 00:27:04 +01:00
Schaich
ee3f25fada Detect Sanitizer support
Sanitizers require both front and backend support on the target platform.
Detect whether applications can be compiled and linked with sanitizer support
and enable sanitizers that can be both compiled and linked with.
check_c_compiler_flags is insufficient here, because we need library support
on top of just compiler support.

This implicitly disables sanitizer support for most cross-compiling and
embedded targets which use gcc or llvm based toolchains but don't have library
support, while enabling it on MSVC and Intel compilers.

While here, bind the sanitizer dependency to the zint library targets, and
remove the hardcoded no-var-tracking-assignments. variable assignment
tracking is a very powerful tool to find the true source of uninitialized
value based conditional jumps, and, if undesired, it can be disabled by
configuring the ASAN_OPTIONS environment variable.
2021-06-25 03:26:12 +09:00
gitlost
54947fb435 Restore backend_qt - static only now; qzint: legacy support for renamed methods 2021-06-24 18:31:08 +01:00
gitlost
70801d8932 tests: VC6 compatible; plot_raster_dotty: avoid float rounding difference 2021-06-23 15:00:49 +01:00
gitlost
e5115bad07 Change height and row_height array to floats: VC6, CodeQL fixes 2021-06-20 00:05:45 +01:00
gitlost
c693482aa1 Change height and row_height array to floats; DAFT tracker ratio 2021-06-19 13:11:23 +01:00
gitlost
22a6c583af test_raster/vector: add height test in prep for float height MR; AZTEC: suppress clang-tidy warning 2021-06-18 01:03:33 +01:00
gitlost
21a4e2c1f6 data file tests: fix [32af28] generate data directory test 2021-06-16 17:56:32 +01:00
gitlost
f6a90c5a48 AZTEC: re MR #122, use printf .* for debug, remove unneeded inits 2021-06-16 17:45:25 +01:00
Schaich
6673289944 Initialize local variable
In `aztec_text_process`, `binary_string`, which aliases to `aztec`'s
`bit_pattern` has it's first element set to NUL. However, when the string
is later written into using `bin_append_posn`, that NUL is overwritten and
further NUL to replace it is not appended.

In general, the garbage collected memory content should never be assumed to
have a specific value unless a value was explicitly assigned, so the content
of `bit_pattern` cannot be safely assumed to be NUL.

If the string is not NUL terminated, functions relying on NUL termination,
such as the printf call at the end of `aztec_text_proccess` itself,
will overrun the array bounds.

Explicitly initialize `bit_pattern`
2021-06-15 17:42:28 +09:00
gitlost
32af280254 testcommon: add testUtilDataPath() (uses getcwd()) so generate works for data files, remove copy 2021-06-14 00:48:29 +01:00
gitlost
8ff15d805a CODABAR: fix [69c1b4] errtxt; CLI: _WIN32, fuller error messages; win32/README: Administrat-or 2021-06-12 16:01:16 +01:00
gitlost
69c1b4cbf0 CODABAR: better error messages; win32/README, zint_cmdline_vc6/readme.txt: fixes 2021-06-10 18:04:27 +01:00
gitlost
ede1234b8f Re MR #121 calcium -> static; reinstate STATIC_UNLESS_ZINT_TEST error_tag/strip_bom; whitespace 2021-06-10 16:20:14 +01:00
Schaich
43d7493cf2 Remove unused variable 2021-06-10 22:46:10 +09:00
Schaich
dce51ceb6d Use "human readable" file mode 2021-06-10 21:01:34 +09:00
Schaich
afea0ad2c3 Get test_library compiled on windows
test_file_unreadable cannot be implemented easily, as files are always
readable by their owner on windows. While `_chmod` is available in the POSIX
compatibility function set, it cannot be used to take away read permissions,
either.

While here, move functional code out of any assert statements. It shall be
executed even when the assertions are disabled
2021-06-10 21:00:42 +09:00
Schaich
e7947dc9a4 Merge String Constant
The `CALCIUM` "name" is a macro which expands to a string constant.

Referencing the macro twice will cause it to be expanded twice, resulting
in two string instances which have identical content. By default, gcc will
deduplicate these two strings into the same memory region as gcc detects
the duplicated constant, even when optimization turned off (see
-fmerge-constants and -fmerge-all-constants GCC options).

The C Language specification does not require duplicated constants to be
deduplicated, and, in fact, the GCC manual page also explicitly states
this optimization is not performed for all targets.

Visual C++, in debug mode, does not deduplicate constants. This results
in `count += strchr(CALCIUM,x) - CALCIUM` yielding to negative values as
the substracted CALCIUM's expansion resides on a greater memory address
then the memory allocated for the expansion passed to `strchr`. The
value of `count` is used to compute the checksum, which then is not only
faulty, but also used as an array index without previously checking
whether or not the index is within the array bounds (modulo of a negative
integer is negative, which means out of bounds). This will cause very
difficult to predict behavior, in most cases, however, it will cause a
segmentation fault.

Manually allocate a memory range to contain the string, and use
this range instead of expanding the macro multiple times.
2021-06-10 20:29:04 +09:00
gitlost
4a8cac2a5a CODEONE/DATAMATRIX/MAILMARK/PLESSEY: fix some 32-bit/portability bugs
PLESSEY: add options NCR weighted mod-10, hide check digit(s) in HRT
test suite: now runnable under MSVC 2019, 2017, 2015, MinGW/MSYS
win32/README: update with MSVC 2019 and CMake instructions
2021-06-10 11:15:39 +01:00
Schaich
f471bb6e50 Export the INTERNAL functions
The testcommon library, which is outside of this link unit, is
referencing the INTERNAL functions, so despite the name they
need to be exported. The export code is copy&pasted from the
ZINT_EXTERN definition which can't be reused over preprocessor
limitations.

We might just use ZINT_EXTERN instead though
2021-06-02 21:14:14 +09:00
Schaich
00199c7ef5 The zint library always is shared
The SHARED attribute is forced via the add_library, so the default
value of cmake is ignored. Also, this option should obviously not
be set for the `zint-static` library
2021-06-02 21:14:14 +09:00
Schaich
2221cb1e83 Fix "most" compilation issues MSVC has
test_library is still broken
2021-06-02 21:14:14 +09:00
Schaich
88bbeb862b Move getopt out of the frontend, because it's used in the backend's test, too 2021-06-02 21:14:14 +09:00
Schaich
779a318c93 The testRun function uses getopt(), which is troublesome because the bundled implementation is part of the front-end 2021-06-02 21:14:14 +09:00
Schaich
443e696411 Document the need to set PATH correctly 2021-06-02 21:14:14 +09:00
Schaich
3114a6697b Factor out the zint_add_test macro 2021-06-02 21:14:14 +09:00
Schaich
b69df5ad91 Apply all changes done to the backend test to the front-end test, too 2021-06-02 21:14:14 +09:00
Schaich
9ff3f13c19 Optionalize the PNG and the Qt dependencies
Expose the ability to turn these dependencies off, which results in reduced
functionality. However, it enables a developer using the zint library to
instruct cmake to build a libzint as deployed by e.g. build servers which
don't have png/zint installed, without having to uninstall those libraries
from the development system
2021-06-02 21:14:14 +09:00
Schaich
fd656358a3 Add zint-test's testcommon include directory to consumers of the library 2021-06-02 21:14:14 +09:00
Schaich
386a8059d3 don't manually setup a library path 2021-06-02 21:14:14 +09:00