Commit 4963ce6a533fdb423f00a13f0e15f96b33325f18

Authored by Jay Berkenbilt
1 parent 1393f56e

Remove obsolete LL_FMT check from build (fixes #768)

This was broken for cross-compilation and has probably been
unnecessary for several years now.

Also fix extraneous whitespace in related some tests.
ChangeLog
  1 +2022-09-12 Jay Berkenbilt <ejb@ql.org>
  2 +
  3 + * Remove compile-time test for LL_FMT. It's unlikely that any
  4 + compiler new enough to build qpdf still doesn't support %lld.
  5 +
1 6 2022-09-10 Jay Berkenbilt <ejb@ql.org>
2 7  
3 8 * 11.0.0: release
... ...
libqpdf/CMakeLists.txt
... ... @@ -361,24 +361,6 @@ if(LFS_WITH_MACROS AND NOT LFS_WITHOUT_MACROS)
361 361 set(_FILE_OFFSET_BITS 64)
362 362 endif()
363 363  
364   -function(qpdf_check_ll_fmt fmt var)
365   - if(NOT DEFINED LL_FMT)
366   - check_c_source_runs(
367   - "#define _CRT_SECURE_NO_WARNINGS
368   -#include <stdio.h>
369   -#include <string.h>
370   -int main(int argc, char* argv[]) {
371   - long long int a = 123456789012345ll;
372   - char s[30];
373   - sprintf(s, \"${fmt}\", a);
374   - return (strcmp(s, \"123456789012345\") == 0) ? 0 : 1;
375   -}" ${var})
376   - if(${var})
377   - set(LL_FMT "${fmt}" PARENT_SCOPE)
378   - endif()
379   - endif()
380   -endfunction()
381   -
382 364 check_c_source_compiles(
383 365 "#include <malloc.h>
384 366 #include <stdio.h>
... ... @@ -402,10 +384,6 @@ int main(int argc, char* argv[]) {
402 384 }"
403 385 HAVE_OPEN_MEMSTREAM)
404 386  
405   -qpdf_check_ll_fmt("%lld" fmt_lld)
406   -qpdf_check_ll_fmt("%I64d" fmt_i64d)
407   -qpdf_check_ll_fmt("%I64lld" fmt_i64lld)
408   -
409 387 configure_file(
410 388 "${CMAKE_CURRENT_SOURCE_DIR}/qpdf/qpdf-config.h.in"
411 389 "${CMAKE_CURRENT_BINARY_DIR}/qpdf/qpdf-config.h"
... ...
libqpdf/qpdf/qpdf-config.h.in
... ... @@ -24,9 +24,6 @@
24 24 #cmakedefine HAVE_MALLOC_INFO 1
25 25 #cmakedefine HAVE_OPEN_MEMSTREAM 1
26 26  
27   -/* printf format for long long */
28   -#cmakedefine LL_FMT "${LL_FMT}"
29   -
30 27 /* system random device (e.g. /dev/random) if any */
31 28 #cmakedefine RANDOM_DEVICE "${RANDOM_DEVICE}"
32 29  
... ...
manual/release-notes.rst
... ... @@ -8,6 +8,12 @@ For a detailed list of changes, please see the file
8 8  
9 9 .. x.y.z: not yet released
10 10  
  11 +11.0.1: not yet released
  12 + - Build fixes
  13 +
  14 + - Remove ``LL_FMT`` tests, which were broken for cross
  15 + compilation. The code just uses ``%lld`` now.
  16 +
11 17 11.0.0: September 10, 2022
12 18 - Replacement of ``PointerHolder`` with ``std::shared_ptr``
13 19  
... ...
qpdf/CMakeLists.txt
... ... @@ -27,7 +27,6 @@ foreach(PROG ${MAIN_C_PROGRAMS})
27 27 target_link_libraries(${PROG} libqpdf)
28 28 set_property(TARGET ${PROG} PROPERTY LINKER_LANGUAGE CXX)
29 29 endforeach()
30   -target_include_directories(qpdf-ctest PRIVATE ${CMAKE_BINARY_DIR}/libqpdf)
31 30 target_include_directories(sizes PRIVATE ${JPEG_INCLUDE})
32 31  
33 32 set(needs_private_headers
... ...
qpdf/qpdf-ctest.c
... ... @@ -6,8 +6,6 @@
6 6 #include <stdlib.h>
7 7 #include <string.h>
8 8  
9   -#include <qpdf/qpdf-config.h> // for LL_FMT -- special case in build
10   -
11 9 static char* whoami = 0;
12 10 static qpdf_data qpdf = 0;
13 11  
... ... @@ -42,11 +40,10 @@ safe_fopen(char const* filename, char const* mode)
42 40 static void
43 41 print_error(char const* label, qpdf_data q, qpdf_error e)
44 42 {
45   -#define POS_FMT " pos : " LL_FMT "\n"
46 43 printf("%s: %s\n", label, qpdf_get_error_full_text(q, e));
47 44 printf(" code: %d\n", qpdf_get_error_code(q, e));
48 45 printf(" file: %s\n", qpdf_get_error_filename(q, e));
49   - printf(POS_FMT, qpdf_get_error_file_position(q, e));
  46 + printf(" pos: %lld\n", qpdf_get_error_file_position(q, e));
50 47 printf(" text: %s\n", qpdf_get_error_message_detail(q, e));
51 48 }
52 49  
... ...
qpdf/qtest/qpdf/append-page-content-damaged-c-check.out
... ... @@ -7,16 +7,16 @@ encrypted: 0
7 7 warning: append-page-content-damaged.pdf: file is damaged
8 8 code: 5
9 9 file: append-page-content-damaged.pdf
10   - pos : 0
  10 + pos: 0
11 11 text: file is damaged
12 12 warning: append-page-content-damaged.pdf: can't find startxref
13 13 code: 5
14 14 file: append-page-content-damaged.pdf
15   - pos : 0
  15 + pos: 0
16 16 text: can't find startxref
17 17 warning: append-page-content-damaged.pdf: Attempting to reconstruct cross-reference table
18 18 code: 5
19 19 file: append-page-content-damaged.pdf
20   - pos : 0
  20 + pos: 0
21 21 text: Attempting to reconstruct cross-reference table
22 22 C test 1 done
... ...
qpdf/qtest/qpdf/c-check-warn.out
... ... @@ -5,16 +5,16 @@ status: 1
5 5 warning: c-check-warn-in.pdf: file is damaged
6 6 code: 5
7 7 file: c-check-warn-in.pdf
8   - pos : 0
  8 + pos: 0
9 9 text: file is damaged
10 10 warning: c-check-warn-in.pdf (offset 1556): xref not found
11 11 code: 5
12 12 file: c-check-warn-in.pdf
13   - pos : 1556
  13 + pos: 1556
14 14 text: xref not found
15 15 warning: c-check-warn-in.pdf: Attempting to reconstruct cross-reference table
16 16 code: 5
17 17 file: c-check-warn-in.pdf
18   - pos : 0
  18 + pos: 0
19 19 text: Attempting to reconstruct cross-reference table
20 20 C test 23 done
... ...
qpdf/qtest/qpdf/c-get-stream.out
... ... @@ -2,12 +2,12 @@ page content on broken page
2 2 error: page object 5 0: object is supposed to be a stream or an array of streams but is neither
3 3 code: 5
4 4 file:
5   - pos : 0
  5 + pos: 0
6 6 text: object is supposed to be a stream or an array of streams but is neither
7 7 stream data for non stream
8 8 error: operation for stream attempted on object of type dictionary
9 9 code: 2
10 10 file:
11   - pos : 0
  11 + pos: 0
12 12 text: operation for stream attempted on object of type dictionary
13 13 C test 38 done
... ...
qpdf/qtest/qpdf/c-invalid-password.out
1 1 error: enc-R2,V1,U=view,O=view.pdf: invalid password
2 2 code: 4
3 3 file: enc-R2,V1,U=view,O=view.pdf
4   - pos : 0
  4 + pos: 0
5 5 text: invalid password
6 6 C test 2 done
... ...
qpdf/qtest/qpdf/c-no-recovery.out
1 1 error: bad33.pdf (offset 1771): xref not found
2 2 code: 5
3 3 file: bad33.pdf
4   - pos : 1771
  4 + pos: 1771
5 5 text: xref not found
6 6 C test 10 done
... ...
qpdf/qtest/qpdf/c-object-handles.out
... ... @@ -13,11 +13,11 @@ minimal.pdf (C API object handle 9): attempted access to unknown object handle
13 13 warning: minimal.pdf: C API function caught an exception that it isn't returning; please point the application developer to ERROR HANDLING in qpdf-c.h
14 14 code: 1
15 15 file: minimal.pdf
16   - pos : 0
  16 + pos: 0
17 17 text: C API function caught an exception that it isn't returning; please point the application developer to ERROR HANDLING in qpdf-c.h
18 18 error: minimal.pdf (C API object handle 9): attempted access to unknown object handle
19 19 code: 1
20 20 file: minimal.pdf
21   - pos : 0
  21 + pos: 0
22 22 text: attempted access to unknown object handle
23 23 C test 24 done
... ...
qpdf/qtest/qpdf/c-oh-errors.out
1 1 get root: attempted to dereference an uninitialized QPDFObjectHandle
2 2 code: 1
3 3 file:
4   - pos : 0
  4 + pos: 0
5 5 text: attempted to dereference an uninitialized QPDFObjectHandle
6 6 bad parse: parsed object (offset 1): unknown token while reading object; treating as string
7 7 code: 5
8 8 file: parsed object
9   - pos : 1
  9 + pos: 1
10 10 text: unknown token while reading object; treating as string
11 11 type mismatch (int operation on string): operation for integer attempted on object of type string: returning 0
12 12 code: 7
13 13 file:
14   - pos : 0
  14 + pos: 0
15 15 text: operation for integer attempted on object of type string: returning 0
16 16 type mismatch (string operation on int): operation for string attempted on object of type integer: returning empty string
17 17 code: 7
18 18 file:
19   - pos : 0
  19 + pos: 0
20 20 text: operation for string attempted on object of type integer: returning empty string
21 21 array type mismatch - n_items: operation for array attempted on object of type integer: treating as empty
22 22 code: 7
23 23 file:
24   - pos : 0
  24 + pos: 0
25 25 text: operation for array attempted on object of type integer: treating as empty
26 26 array type mismatch - item: operation for array attempted on object of type integer: returning null
27 27 code: 7
28 28 file:
29   - pos : 0
  29 + pos: 0
30 30 text: operation for array attempted on object of type integer: returning null
31 31 append to non-array: operation for array attempted on object of type integer: ignoring attempt to append item
32 32 code: 7
33 33 file:
34   - pos : 0
  34 + pos: 0
35 35 text: operation for array attempted on object of type integer: ignoring attempt to append item
36 36 array bounds: returning null for out of bounds array access
37 37 code: 7
38 38 file:
39   - pos : 0
  39 + pos: 0
40 40 text: returning null for out of bounds array access
41 41 dictionary iter type mismatch: operation for dictionary attempted on object of type integer: treating as empty
42 42 code: 7
43 43 file:
44   - pos : 0
  44 + pos: 0
45 45 text: operation for dictionary attempted on object of type integer: treating as empty
46 46 dictionary type mismatch: operation for dictionary attempted on object of type integer: returning null for attempted key retrieval
47 47 code: 7
48 48 file:
49   - pos : 0
  49 + pos: 0
50 50 text: operation for dictionary attempted on object of type integer: returning null for attempted key retrieval
51 51 dictionary type mismatch: operation for dictionary attempted on object of type integer: returning false for a key containment request
52 52 code: 7
53 53 file:
54   - pos : 0
  54 + pos: 0
55 55 text: operation for dictionary attempted on object of type integer: returning false for a key containment request
56 56 C test 29 done
... ...
qpdf/qtest/qpdf/c-page-errors.out
... ... @@ -4,11 +4,11 @@ WARNING: object 27 0: operation for dictionary attempted on object of type null:
4 4 warning: object 27 0: operation for dictionary attempted on object of type null: ignoring key replacement request
5 5 code: 7
6 6 file:
7   - pos : 0
  7 + pos: 0
8 8 text: operation for dictionary attempted on object of type null: ignoring key replacement request
9 9 error: 11-pages.pdf (C API object handle 1000): attempted access to unknown object handle
10 10 code: 1
11 11 file: 11-pages.pdf
12   - pos : 0
  12 + pos: 0
13 13 text: attempted access to unknown object handle
14 14 C test 35 done
... ...
qpdf/qtest/qpdf/c-read-errors.out
1 1 warning: bad1.pdf: can't find PDF header
2 2 code: 5
3 3 file: bad1.pdf
4   - pos : 0
  4 + pos: 0
5 5 text: can't find PDF header
6 6 warning: bad1.pdf: file is damaged
7 7 code: 5
8 8 file: bad1.pdf
9   - pos : 0
  9 + pos: 0
10 10 text: file is damaged
11 11 warning: bad1.pdf: can't find startxref
12 12 code: 5
13 13 file: bad1.pdf
14   - pos : 0
  14 + pos: 0
15 15 text: can't find startxref
16 16 warning: bad1.pdf: Attempting to reconstruct cross-reference table
17 17 code: 5
18 18 file: bad1.pdf
19   - pos : 0
  19 + pos: 0
20 20 text: Attempting to reconstruct cross-reference table
21 21 error: bad1.pdf: unable to find trailer dictionary while recovering damaged file
22 22 code: 5
23 23 file: bad1.pdf
24   - pos : 0
  24 + pos: 0
25 25 text: unable to find trailer dictionary while recovering damaged file
26 26 C test 2 done
... ...
qpdf/qtest/qpdf/c-write-damaged.out
1 1 warning: append-page-content-damaged.pdf: file is damaged
2 2 code: 5
3 3 file: append-page-content-damaged.pdf
4   - pos : 0
  4 + pos: 0
5 5 text: file is damaged
6 6 warning: append-page-content-damaged.pdf: can't find startxref
7 7 code: 5
8 8 file: append-page-content-damaged.pdf
9   - pos : 0
  9 + pos: 0
10 10 text: can't find startxref
11 11 warning: append-page-content-damaged.pdf: Attempting to reconstruct cross-reference table
12 12 code: 5
13 13 file: append-page-content-damaged.pdf
14   - pos : 0
  14 + pos: 0
15 15 text: Attempting to reconstruct cross-reference table
16 16 C test 2 done
... ...
qpdf/qtest/qpdf/c-write-warnings.out
1 1 warning: bad33.pdf: file is damaged
2 2 code: 5
3 3 file: bad33.pdf
4   - pos : 0
  4 + pos: 0
5 5 text: file is damaged
6 6 warning: bad33.pdf (offset 1771): xref not found
7 7 code: 5
8 8 file: bad33.pdf
9   - pos : 1771
  9 + pos: 1771
10 10 text: xref not found
11 11 warning: bad33.pdf: Attempting to reconstruct cross-reference table
12 12 code: 5
13 13 file: bad33.pdf
14   - pos : 0
  14 + pos: 0
15 15 text: Attempting to reconstruct cross-reference table
16 16 warning: bad33.pdf (offset 629): stream filter type is not name or array
17 17 code: 5
18 18 file: bad33.pdf
19   - pos : 629
  19 + pos: 629
20 20 text: stream filter type is not name or array
21 21 C test 2 done
... ...
qpdf/qtest/qpdf/damaged-stream-c-check.out
1 1 warning: damaged-stream.pdf (offset 426): error decoding stream data for object 5 0: LZWDecoder: bad code received
2 2 code: 5
3 3 file: damaged-stream.pdf
4   - pos : 426
  4 + pos: 426
5 5 text: error decoding stream data for object 5 0: LZWDecoder: bad code received
6 6 warning: damaged-stream.pdf (offset 426): stream will be re-processed without filtering to avoid data loss
7 7 code: 5
8 8 file: damaged-stream.pdf
9   - pos : 426
  9 + pos: 426
10 10 text: stream will be re-processed without filtering to avoid data loss
11 11 C test 2 done
... ...