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 2022-09-10 Jay Berkenbilt <ejb@ql.org> 6 2022-09-10 Jay Berkenbilt <ejb@ql.org>
2 7
3 * 11.0.0: release 8 * 11.0.0: release
libqpdf/CMakeLists.txt
@@ -361,24 +361,6 @@ if(LFS_WITH_MACROS AND NOT LFS_WITHOUT_MACROS) @@ -361,24 +361,6 @@ if(LFS_WITH_MACROS AND NOT LFS_WITHOUT_MACROS)
361 set(_FILE_OFFSET_BITS 64) 361 set(_FILE_OFFSET_BITS 64)
362 endif() 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 check_c_source_compiles( 364 check_c_source_compiles(
383 "#include <malloc.h> 365 "#include <malloc.h>
384 #include <stdio.h> 366 #include <stdio.h>
@@ -402,10 +384,6 @@ int main(int argc, char* argv[]) { @@ -402,10 +384,6 @@ int main(int argc, char* argv[]) {
402 }" 384 }"
403 HAVE_OPEN_MEMSTREAM) 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 configure_file( 387 configure_file(
410 "${CMAKE_CURRENT_SOURCE_DIR}/qpdf/qpdf-config.h.in" 388 "${CMAKE_CURRENT_SOURCE_DIR}/qpdf/qpdf-config.h.in"
411 "${CMAKE_CURRENT_BINARY_DIR}/qpdf/qpdf-config.h" 389 "${CMAKE_CURRENT_BINARY_DIR}/qpdf/qpdf-config.h"
libqpdf/qpdf/qpdf-config.h.in
@@ -24,9 +24,6 @@ @@ -24,9 +24,6 @@
24 #cmakedefine HAVE_MALLOC_INFO 1 24 #cmakedefine HAVE_MALLOC_INFO 1
25 #cmakedefine HAVE_OPEN_MEMSTREAM 1 25 #cmakedefine HAVE_OPEN_MEMSTREAM 1
26 26
27 -/* printf format for long long */  
28 -#cmakedefine LL_FMT "${LL_FMT}"  
29 -  
30 /* system random device (e.g. /dev/random) if any */ 27 /* system random device (e.g. /dev/random) if any */
31 #cmakedefine RANDOM_DEVICE "${RANDOM_DEVICE}" 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,6 +8,12 @@ For a detailed list of changes, please see the file
8 8
9 .. x.y.z: not yet released 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 11.0.0: September 10, 2022 17 11.0.0: September 10, 2022
12 - Replacement of ``PointerHolder`` with ``std::shared_ptr`` 18 - Replacement of ``PointerHolder`` with ``std::shared_ptr``
13 19
qpdf/CMakeLists.txt
@@ -27,7 +27,6 @@ foreach(PROG ${MAIN_C_PROGRAMS}) @@ -27,7 +27,6 @@ foreach(PROG ${MAIN_C_PROGRAMS})
27 target_link_libraries(${PROG} libqpdf) 27 target_link_libraries(${PROG} libqpdf)
28 set_property(TARGET ${PROG} PROPERTY LINKER_LANGUAGE CXX) 28 set_property(TARGET ${PROG} PROPERTY LINKER_LANGUAGE CXX)
29 endforeach() 29 endforeach()
30 -target_include_directories(qpdf-ctest PRIVATE ${CMAKE_BINARY_DIR}/libqpdf)  
31 target_include_directories(sizes PRIVATE ${JPEG_INCLUDE}) 30 target_include_directories(sizes PRIVATE ${JPEG_INCLUDE})
32 31
33 set(needs_private_headers 32 set(needs_private_headers
qpdf/qpdf-ctest.c
@@ -6,8 +6,6 @@ @@ -6,8 +6,6 @@
6 #include <stdlib.h> 6 #include <stdlib.h>
7 #include <string.h> 7 #include <string.h>
8 8
9 -#include <qpdf/qpdf-config.h> // for LL_FMT -- special case in build  
10 -  
11 static char* whoami = 0; 9 static char* whoami = 0;
12 static qpdf_data qpdf = 0; 10 static qpdf_data qpdf = 0;
13 11
@@ -42,11 +40,10 @@ safe_fopen(char const* filename, char const* mode) @@ -42,11 +40,10 @@ safe_fopen(char const* filename, char const* mode)
42 static void 40 static void
43 print_error(char const* label, qpdf_data q, qpdf_error e) 41 print_error(char const* label, qpdf_data q, qpdf_error e)
44 { 42 {
45 -#define POS_FMT " pos : " LL_FMT "\n"  
46 printf("%s: %s\n", label, qpdf_get_error_full_text(q, e)); 43 printf("%s: %s\n", label, qpdf_get_error_full_text(q, e));
47 printf(" code: %d\n", qpdf_get_error_code(q, e)); 44 printf(" code: %d\n", qpdf_get_error_code(q, e));
48 printf(" file: %s\n", qpdf_get_error_filename(q, e)); 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 printf(" text: %s\n", qpdf_get_error_message_detail(q, e)); 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,16 +7,16 @@ encrypted: 0
7 warning: append-page-content-damaged.pdf: file is damaged 7 warning: append-page-content-damaged.pdf: file is damaged
8 code: 5 8 code: 5
9 file: append-page-content-damaged.pdf 9 file: append-page-content-damaged.pdf
10 - pos : 0 10 + pos: 0
11 text: file is damaged 11 text: file is damaged
12 warning: append-page-content-damaged.pdf: can't find startxref 12 warning: append-page-content-damaged.pdf: can't find startxref
13 code: 5 13 code: 5
14 file: append-page-content-damaged.pdf 14 file: append-page-content-damaged.pdf
15 - pos : 0 15 + pos: 0
16 text: can't find startxref 16 text: can't find startxref
17 warning: append-page-content-damaged.pdf: Attempting to reconstruct cross-reference table 17 warning: append-page-content-damaged.pdf: Attempting to reconstruct cross-reference table
18 code: 5 18 code: 5
19 file: append-page-content-damaged.pdf 19 file: append-page-content-damaged.pdf
20 - pos : 0 20 + pos: 0
21 text: Attempting to reconstruct cross-reference table 21 text: Attempting to reconstruct cross-reference table
22 C test 1 done 22 C test 1 done
qpdf/qtest/qpdf/c-check-warn.out
@@ -5,16 +5,16 @@ status: 1 @@ -5,16 +5,16 @@ status: 1
5 warning: c-check-warn-in.pdf: file is damaged 5 warning: c-check-warn-in.pdf: file is damaged
6 code: 5 6 code: 5
7 file: c-check-warn-in.pdf 7 file: c-check-warn-in.pdf
8 - pos : 0 8 + pos: 0
9 text: file is damaged 9 text: file is damaged
10 warning: c-check-warn-in.pdf (offset 1556): xref not found 10 warning: c-check-warn-in.pdf (offset 1556): xref not found
11 code: 5 11 code: 5
12 file: c-check-warn-in.pdf 12 file: c-check-warn-in.pdf
13 - pos : 1556 13 + pos: 1556
14 text: xref not found 14 text: xref not found
15 warning: c-check-warn-in.pdf: Attempting to reconstruct cross-reference table 15 warning: c-check-warn-in.pdf: Attempting to reconstruct cross-reference table
16 code: 5 16 code: 5
17 file: c-check-warn-in.pdf 17 file: c-check-warn-in.pdf
18 - pos : 0 18 + pos: 0
19 text: Attempting to reconstruct cross-reference table 19 text: Attempting to reconstruct cross-reference table
20 C test 23 done 20 C test 23 done
qpdf/qtest/qpdf/c-get-stream.out
@@ -2,12 +2,12 @@ page content on broken page @@ -2,12 +2,12 @@ page content on broken page
2 error: page object 5 0: object is supposed to be a stream or an array of streams but is neither 2 error: page object 5 0: object is supposed to be a stream or an array of streams but is neither
3 code: 5 3 code: 5
4 file: 4 file:
5 - pos : 0 5 + pos: 0
6 text: object is supposed to be a stream or an array of streams but is neither 6 text: object is supposed to be a stream or an array of streams but is neither
7 stream data for non stream 7 stream data for non stream
8 error: operation for stream attempted on object of type dictionary 8 error: operation for stream attempted on object of type dictionary
9 code: 2 9 code: 2
10 file: 10 file:
11 - pos : 0 11 + pos: 0
12 text: operation for stream attempted on object of type dictionary 12 text: operation for stream attempted on object of type dictionary
13 C test 38 done 13 C test 38 done
qpdf/qtest/qpdf/c-invalid-password.out
1 error: enc-R2,V1,U=view,O=view.pdf: invalid password 1 error: enc-R2,V1,U=view,O=view.pdf: invalid password
2 code: 4 2 code: 4
3 file: enc-R2,V1,U=view,O=view.pdf 3 file: enc-R2,V1,U=view,O=view.pdf
4 - pos : 0 4 + pos: 0
5 text: invalid password 5 text: invalid password
6 C test 2 done 6 C test 2 done
qpdf/qtest/qpdf/c-no-recovery.out
1 error: bad33.pdf (offset 1771): xref not found 1 error: bad33.pdf (offset 1771): xref not found
2 code: 5 2 code: 5
3 file: bad33.pdf 3 file: bad33.pdf
4 - pos : 1771 4 + pos: 1771
5 text: xref not found 5 text: xref not found
6 C test 10 done 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,11 +13,11 @@ minimal.pdf (C API object handle 9): attempted access to unknown object handle
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 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 code: 1 14 code: 1
15 file: minimal.pdf 15 file: minimal.pdf
16 - pos : 0 16 + pos: 0
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 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 error: minimal.pdf (C API object handle 9): attempted access to unknown object handle 18 error: minimal.pdf (C API object handle 9): attempted access to unknown object handle
19 code: 1 19 code: 1
20 file: minimal.pdf 20 file: minimal.pdf
21 - pos : 0 21 + pos: 0
22 text: attempted access to unknown object handle 22 text: attempted access to unknown object handle
23 C test 24 done 23 C test 24 done
qpdf/qtest/qpdf/c-oh-errors.out
1 get root: attempted to dereference an uninitialized QPDFObjectHandle 1 get root: attempted to dereference an uninitialized QPDFObjectHandle
2 code: 1 2 code: 1
3 file: 3 file:
4 - pos : 0 4 + pos: 0
5 text: attempted to dereference an uninitialized QPDFObjectHandle 5 text: attempted to dereference an uninitialized QPDFObjectHandle
6 bad parse: parsed object (offset 1): unknown token while reading object; treating as string 6 bad parse: parsed object (offset 1): unknown token while reading object; treating as string
7 code: 5 7 code: 5
8 file: parsed object 8 file: parsed object
9 - pos : 1 9 + pos: 1
10 text: unknown token while reading object; treating as string 10 text: unknown token while reading object; treating as string
11 type mismatch (int operation on string): operation for integer attempted on object of type string: returning 0 11 type mismatch (int operation on string): operation for integer attempted on object of type string: returning 0
12 code: 7 12 code: 7
13 file: 13 file:
14 - pos : 0 14 + pos: 0
15 text: operation for integer attempted on object of type string: returning 0 15 text: operation for integer attempted on object of type string: returning 0
16 type mismatch (string operation on int): operation for string attempted on object of type integer: returning empty string 16 type mismatch (string operation on int): operation for string attempted on object of type integer: returning empty string
17 code: 7 17 code: 7
18 file: 18 file:
19 - pos : 0 19 + pos: 0
20 text: operation for string attempted on object of type integer: returning empty string 20 text: operation for string attempted on object of type integer: returning empty string
21 array type mismatch - n_items: operation for array attempted on object of type integer: treating as empty 21 array type mismatch - n_items: operation for array attempted on object of type integer: treating as empty
22 code: 7 22 code: 7
23 file: 23 file:
24 - pos : 0 24 + pos: 0
25 text: operation for array attempted on object of type integer: treating as empty 25 text: operation for array attempted on object of type integer: treating as empty
26 array type mismatch - item: operation for array attempted on object of type integer: returning null 26 array type mismatch - item: operation for array attempted on object of type integer: returning null
27 code: 7 27 code: 7
28 file: 28 file:
29 - pos : 0 29 + pos: 0
30 text: operation for array attempted on object of type integer: returning null 30 text: operation for array attempted on object of type integer: returning null
31 append to non-array: operation for array attempted on object of type integer: ignoring attempt to append item 31 append to non-array: operation for array attempted on object of type integer: ignoring attempt to append item
32 code: 7 32 code: 7
33 file: 33 file:
34 - pos : 0 34 + pos: 0
35 text: operation for array attempted on object of type integer: ignoring attempt to append item 35 text: operation for array attempted on object of type integer: ignoring attempt to append item
36 array bounds: returning null for out of bounds array access 36 array bounds: returning null for out of bounds array access
37 code: 7 37 code: 7
38 file: 38 file:
39 - pos : 0 39 + pos: 0
40 text: returning null for out of bounds array access 40 text: returning null for out of bounds array access
41 dictionary iter type mismatch: operation for dictionary attempted on object of type integer: treating as empty 41 dictionary iter type mismatch: operation for dictionary attempted on object of type integer: treating as empty
42 code: 7 42 code: 7
43 file: 43 file:
44 - pos : 0 44 + pos: 0
45 text: operation for dictionary attempted on object of type integer: treating as empty 45 text: operation for dictionary attempted on object of type integer: treating as empty
46 dictionary type mismatch: operation for dictionary attempted on object of type integer: returning null for attempted key retrieval 46 dictionary type mismatch: operation for dictionary attempted on object of type integer: returning null for attempted key retrieval
47 code: 7 47 code: 7
48 file: 48 file:
49 - pos : 0 49 + pos: 0
50 text: operation for dictionary attempted on object of type integer: returning null for attempted key retrieval 50 text: operation for dictionary attempted on object of type integer: returning null for attempted key retrieval
51 dictionary type mismatch: operation for dictionary attempted on object of type integer: returning false for a key containment request 51 dictionary type mismatch: operation for dictionary attempted on object of type integer: returning false for a key containment request
52 code: 7 52 code: 7
53 file: 53 file:
54 - pos : 0 54 + pos: 0
55 text: operation for dictionary attempted on object of type integer: returning false for a key containment request 55 text: operation for dictionary attempted on object of type integer: returning false for a key containment request
56 C test 29 done 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,11 +4,11 @@ WARNING: object 27 0: operation for dictionary attempted on object of type null:
4 warning: object 27 0: operation for dictionary attempted on object of type null: ignoring key replacement request 4 warning: object 27 0: operation for dictionary attempted on object of type null: ignoring key replacement request
5 code: 7 5 code: 7
6 file: 6 file:
7 - pos : 0 7 + pos: 0
8 text: operation for dictionary attempted on object of type null: ignoring key replacement request 8 text: operation for dictionary attempted on object of type null: ignoring key replacement request
9 error: 11-pages.pdf (C API object handle 1000): attempted access to unknown object handle 9 error: 11-pages.pdf (C API object handle 1000): attempted access to unknown object handle
10 code: 1 10 code: 1
11 file: 11-pages.pdf 11 file: 11-pages.pdf
12 - pos : 0 12 + pos: 0
13 text: attempted access to unknown object handle 13 text: attempted access to unknown object handle
14 C test 35 done 14 C test 35 done
qpdf/qtest/qpdf/c-read-errors.out
1 warning: bad1.pdf: can't find PDF header 1 warning: bad1.pdf: can't find PDF header
2 code: 5 2 code: 5
3 file: bad1.pdf 3 file: bad1.pdf
4 - pos : 0 4 + pos: 0
5 text: can't find PDF header 5 text: can't find PDF header
6 warning: bad1.pdf: file is damaged 6 warning: bad1.pdf: file is damaged
7 code: 5 7 code: 5
8 file: bad1.pdf 8 file: bad1.pdf
9 - pos : 0 9 + pos: 0
10 text: file is damaged 10 text: file is damaged
11 warning: bad1.pdf: can't find startxref 11 warning: bad1.pdf: can't find startxref
12 code: 5 12 code: 5
13 file: bad1.pdf 13 file: bad1.pdf
14 - pos : 0 14 + pos: 0
15 text: can't find startxref 15 text: can't find startxref
16 warning: bad1.pdf: Attempting to reconstruct cross-reference table 16 warning: bad1.pdf: Attempting to reconstruct cross-reference table
17 code: 5 17 code: 5
18 file: bad1.pdf 18 file: bad1.pdf
19 - pos : 0 19 + pos: 0
20 text: Attempting to reconstruct cross-reference table 20 text: Attempting to reconstruct cross-reference table
21 error: bad1.pdf: unable to find trailer dictionary while recovering damaged file 21 error: bad1.pdf: unable to find trailer dictionary while recovering damaged file
22 code: 5 22 code: 5
23 file: bad1.pdf 23 file: bad1.pdf
24 - pos : 0 24 + pos: 0
25 text: unable to find trailer dictionary while recovering damaged file 25 text: unable to find trailer dictionary while recovering damaged file
26 C test 2 done 26 C test 2 done
qpdf/qtest/qpdf/c-write-damaged.out
1 warning: append-page-content-damaged.pdf: file is damaged 1 warning: append-page-content-damaged.pdf: file is damaged
2 code: 5 2 code: 5
3 file: append-page-content-damaged.pdf 3 file: append-page-content-damaged.pdf
4 - pos : 0 4 + pos: 0
5 text: file is damaged 5 text: file is damaged
6 warning: append-page-content-damaged.pdf: can't find startxref 6 warning: append-page-content-damaged.pdf: can't find startxref
7 code: 5 7 code: 5
8 file: append-page-content-damaged.pdf 8 file: append-page-content-damaged.pdf
9 - pos : 0 9 + pos: 0
10 text: can't find startxref 10 text: can't find startxref
11 warning: append-page-content-damaged.pdf: Attempting to reconstruct cross-reference table 11 warning: append-page-content-damaged.pdf: Attempting to reconstruct cross-reference table
12 code: 5 12 code: 5
13 file: append-page-content-damaged.pdf 13 file: append-page-content-damaged.pdf
14 - pos : 0 14 + pos: 0
15 text: Attempting to reconstruct cross-reference table 15 text: Attempting to reconstruct cross-reference table
16 C test 2 done 16 C test 2 done
qpdf/qtest/qpdf/c-write-warnings.out
1 warning: bad33.pdf: file is damaged 1 warning: bad33.pdf: file is damaged
2 code: 5 2 code: 5
3 file: bad33.pdf 3 file: bad33.pdf
4 - pos : 0 4 + pos: 0
5 text: file is damaged 5 text: file is damaged
6 warning: bad33.pdf (offset 1771): xref not found 6 warning: bad33.pdf (offset 1771): xref not found
7 code: 5 7 code: 5
8 file: bad33.pdf 8 file: bad33.pdf
9 - pos : 1771 9 + pos: 1771
10 text: xref not found 10 text: xref not found
11 warning: bad33.pdf: Attempting to reconstruct cross-reference table 11 warning: bad33.pdf: Attempting to reconstruct cross-reference table
12 code: 5 12 code: 5
13 file: bad33.pdf 13 file: bad33.pdf
14 - pos : 0 14 + pos: 0
15 text: Attempting to reconstruct cross-reference table 15 text: Attempting to reconstruct cross-reference table
16 warning: bad33.pdf (offset 629): stream filter type is not name or array 16 warning: bad33.pdf (offset 629): stream filter type is not name or array
17 code: 5 17 code: 5
18 file: bad33.pdf 18 file: bad33.pdf
19 - pos : 629 19 + pos: 629
20 text: stream filter type is not name or array 20 text: stream filter type is not name or array
21 C test 2 done 21 C test 2 done
qpdf/qtest/qpdf/damaged-stream-c-check.out
1 warning: damaged-stream.pdf (offset 426): error decoding stream data for object 5 0: LZWDecoder: bad code received 1 warning: damaged-stream.pdf (offset 426): error decoding stream data for object 5 0: LZWDecoder: bad code received
2 code: 5 2 code: 5
3 file: damaged-stream.pdf 3 file: damaged-stream.pdf
4 - pos : 426 4 + pos: 426
5 text: error decoding stream data for object 5 0: LZWDecoder: bad code received 5 text: error decoding stream data for object 5 0: LZWDecoder: bad code received
6 warning: damaged-stream.pdf (offset 426): stream will be re-processed without filtering to avoid data loss 6 warning: damaged-stream.pdf (offset 426): stream will be re-processed without filtering to avoid data loss
7 code: 5 7 code: 5
8 file: damaged-stream.pdf 8 file: damaged-stream.pdf
9 - pos : 426 9 + pos: 426
10 text: stream will be re-processed without filtering to avoid data loss 10 text: stream will be re-processed without filtering to avoid data loss
11 C test 2 done 11 C test 2 done