Commit graph

4530 commits

Author SHA1 Message Date
Sebastian Pipping
1ff46dff24 Changes: Fix change log entry for #986 2025-03-29 05:20:28 +01:00
Sebastian Pipping
809dddf341 Changes: Document #999 2025-03-29 05:20:28 +01:00
Sebastian Pipping
e74bf078b8 apply-clang-tidy.sh: Enable warning bugprone-narrowing-conversions 2025-03-29 05:20:28 +01:00
Sebastian Pipping
81e050b738 lib/xmlparse.c: Address clang-tidy warning bugprone-narrowing-conversions
The symptom was:
> [..]/expat/lib/xmlparse.c:826:9: error: narrowing conversion from 'ssize_t' (aka 'long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors]
>   826 |         getrandom(currentTarget, bytesToWrite, getrandomFlags);
>       |         ^
> [..]/expat/lib/xmlparse.c:2765:19: error: narrowing conversion from 'unsigned long' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors]
>  2765 |     int nameLen = sizeof(XML_Char) * (tag->name.strLen + 1);
>       |                   ^
> [..]/expat/lib/xmlparse.c:3734:16: error: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors]
>  3734 |       for (j = nsAttsSize; j != 0;)
>       |                ^
> [..]/expat/lib/xmlparse.c:3800:15: error: narrowing conversion from 'unsigned long' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors]
>  3800 |           j = uriHash & mask; /* index into hash table */
>       |               ^
> [..]/expat/lib/xmlparse.c:3814:30: error: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors]
>  3814 |             j < step ? (j += nsAttsSize - step) : (j -= step);
>       |                              ^
> [..]/expat/lib/xmlparse.c:6309:13: error: narrowing conversion from 'int' to signed type 'char' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors]
>  6309 |             parser->m_prologState.documentEntity &&
>       |             ^
> [..]/expat/lib/xmlparse.c:6314:27: error: narrowing conversion from 'int' to signed type 'char' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors]
>  6314 |         checkEntityDecl = ! dtd->hasParamEntityRefs || dtd->standalone;
>       |                           ^
> [..]/expat/lib/xmlparse.c:7897:10: error: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors]
>  7897 |   next = dtd->scaffCount++;
>       |          ^
> [..]/expat/lib/xmlparse.c:8096:16: error: narrowing conversion from 'XmlBigCount' (aka 'unsigned long long') to 'float' [bugprone-narrowing-conversions,-warnings-as-errors]
>  8096 |             ? (countBytesOutput
>       |                ^
> [..]/expat/lib/xmlparse.c:8098:16: error: narrowing conversion from 'XmlBigCount' (aka 'unsigned long long') to 'float' [bugprone-narrowing-conversions,-warnings-as-errors]
>  8098 |             : ((lenOfShortestInclude
>       |                ^
2025-03-29 05:20:28 +01:00
Sebastian Pipping
44e7f4f0eb xmlwf: Address clang-tidy warning bugprone-narrowing-conversions
The symptom was:
> [..]/expat/xmlwf/xmlfile.c:204:13: error: narrowing conversion from 'ssize_t' (aka 'long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors]
>   204 |     nread = read(fd, buf, g_read_size_bytes);
>       |             ^
> [..]/expat/xmlwf/xmlwf.c:314:14: error: narrowing conversion from 'unsigned long' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors]
>   314 |   numBytes = count * sizeof(XML_Char);
>       |              ^

The solution to read(3) was copied from file xmlwf/readfilemap.c for now.
2025-03-29 05:20:28 +01:00
Sebastian Pipping
91fb56539a fuzz: Address clang-tidy bugprone-narrowing-conversions
The symptom was:
> [..]/expat/fuzz/xml_parse_fuzzer.c:68:40: error: narrowing conversion from 'size_t' (aka 'unsigned long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors]
>    68 |   XML_Parse(p, (const XML_Char *)data, size, 0);
>       |                                        ^
> [..]/expat/fuzz/xml_parse_fuzzer.c:69:44: error: narrowing conversion from 'size_t' (aka 'unsigned long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors]
>    69 |   if (XML_Parse(p, (const XML_Char *)data, size, 1) == XML_STATUS_ERROR) {
>       |                                            ^
> [..]/expat/fuzz/xml_parsebuffer_fuzzer.c:69:32: error: narrowing conversion from 'size_t' (aka 'unsigned long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors]
>    69 |   void *buf = XML_GetBuffer(p, size);
>       |                                ^
> [..]/expat/fuzz/xml_parsebuffer_fuzzer.c:72:22: error: narrowing conversion from 'size_t' (aka 'unsigned long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors]
>    72 |   XML_ParseBuffer(p, size, 0);
>       |                      ^
> [..]/expat/fuzz/xml_parsebuffer_fuzzer.c:73:26: error: narrowing conversion from 'size_t' (aka 'unsigned long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors]
>    73 |   buf = XML_GetBuffer(p, size);
>       |                          ^
> [..]/expat/fuzz/xml_parsebuffer_fuzzer.c:78:26: error: narrowing conversion from 'size_t' (aka 'unsigned long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors]
>    78 |   if (XML_ParseBuffer(p, size, 1) == XML_STATUS_ERROR) {
>       |                          ^
2025-03-29 05:20:28 +01:00
Sebastian Pipping
3c946a4629 tests: Address clang-tidy warning bugprone-narrowing-conversions
The symptom was:
> [..]/expat/tests/alloc_tests.c:326:26: error: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors]
>   326 |     g_allocation_count = i;
>       |                          ^
> [..]/expat/tests/alloc_tests.c:437:26: error: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors]
>   437 |     g_allocation_count = i;
>       |                          ^

> [..]/expat/tests/basic_tests.c:415:47: error: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors]
>   415 |   if (_XML_Parse_SINGLE_BYTES(g_parser, text, first_chunk_bytes, XML_FALSE)
>       |                                               ^
> [..]/expat/tests/basic_tests.c:421:34: error: narrowing conversion from 'unsigned long' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors]
>   421 |                                  sizeof(text) - first_chunk_bytes - 1,
>       |                                  ^

> [..]/expat/tests/handlers.c:92:37: error: narrowing conversion from 'XML_Size' (aka 'unsigned long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors]
>    92 |   StructData_AddItem(storage, name, XML_GetCurrentColumnNumber(g_parser),
>       |                                     ^
> [..]/expat/tests/handlers.c:93:22: error: narrowing conversion from 'XML_Size' (aka 'unsigned long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors]
>    93 |                      XML_GetCurrentLineNumber(g_parser), STRUCT_START_TAG);
>       |                      ^
> [..]/expat/tests/handlers.c:99:37: error: narrowing conversion from 'XML_Size' (aka 'unsigned long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors]
>    99 |   StructData_AddItem(storage, name, XML_GetCurrentColumnNumber(g_parser),
>       |                                     ^
> [..]/expat/tests/handlers.c💯22: error: narrowing conversion from 'XML_Size' (aka 'unsigned long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors]
>   100 |                      XML_GetCurrentLineNumber(g_parser), STRUCT_END_TAG);
>       |                      ^
> [..]/expat/tests/handlers.c:1279:26: error: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors]
>  1279 |     g_allocation_count = i;
>       |                          ^

> [..]/expat/tests/misc_tests.c:73:26: error: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors]
>    73 |     g_allocation_count = i;
>       |                          ^
> [..]/expat/tests/misc_tests.c:93:26: error: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors]
>    93 |     g_allocation_count = i;
>       |                          ^

> [..]/expat/tests/nsalloc_tests.c:86:26: error: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors]
>    86 |     g_allocation_count = i;
>       |                          ^
> [..]/expat/tests/nsalloc_tests.c:526:28: error: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors]
>   526 |     g_reallocation_count = i;
>       |                            ^
2025-03-29 05:20:28 +01:00
Sebastian Pipping
f0a7bd1bc8 tests: Address clang-tidy warning bugprone-suspicious-string-compare
The symptom was:
> [..]/expat/tests/handlers.c:135:19: error: function 'strcmp' is called without explicitly comparing result [bugprone-suspicious-string-compare,-warnings-as-errors]
>   135 |   if (id != -1 && xcstrcmp(atts[id], info->id_name)) {
>       |                   ^
>       |                                                     != 0
2025-03-29 05:20:28 +01:00
Sebastian Pipping
c531ed3245 apply-clang-tidy.sh: Exclude include-only file lib/xcsinc.c
.. from inspection in isolation
2025-03-29 05:20:28 +01:00
Sebastian Pipping
822589f93f xmlwf/unixfilemap.c: Simplify "(void *)0" to NULL 2025-03-29 05:20:20 +01:00
Sebastian Pipping
9bad228113 xmlwf/unixfilemap.c: Address clang-tidy warning google-readability-casting 2025-03-29 01:33:50 +01:00
Sebastian Pipping
03ff328b5c
Merge pull request #994 from libexpat/readme-drop-appveyor-badge
Some checks failed
Ensure that GNU Autotools and CMake build systems agree / Ensure that GNU Autotools and CMake build systems agree (push) Has been cancelled
Enforce clang-format clean code / Enforce clang-format clean code (push) Has been cancelled
Enforce codespell-clean spelling / Enforce codespell-clean spelling (push) Has been cancelled
Run Cppcheck (from macOS Homebrew) / Run Cppcheck (push) Has been cancelled
Build with Emscripten / Build with Emscripten (push) Has been cancelled
Collect test coverage / Collect test coverage (push) Has been cancelled
Upload build to Coverity Scan / Upload build to Coverity Scan (push) Has been cancelled
Run macOS CI tasks / Perform checks (push) Has been cancelled
Build with musl / Build with musl (push) Has been cancelled
Build on Windows / Build on Windows (windows-2022, x64, wchar_t) (push) Has been cancelled
Enforce Clang Static Analyzer (scan-build) clean code / Enforce Clang Static Analyzer (scan-build) clean code (push) Has been cancelled
Enforce clang-tidy clean code / Enforce clang-tidy clean code (push) Has been cancelled
Ensure realistic minimum CMake version requirement / Ensure realistic minimum CMake version requirement (push) Has been cancelled
Check expat_config.h.{in,cmake} for regressions / Check expat_config.h.{in,cmake} for regressions (push) Has been cancelled
Run fuzzing regression tests / Run fuzzing regression tests (push) Has been cancelled
Run Linux CI tasks / Perform checks (push) Has been cancelled
Build Windows binaries / Build win64 binaries (push) Has been cancelled
Build on Windows / Build on Windows (windows-2019, Win32, char) (push) Has been cancelled
Run Perl XML::Parser integration tests / Run Perl XML::Parser integration tests (push) Has been cancelled
Ensure well-formed and valid XML / Ensure well-formed and valid XML (push) Has been cancelled
Build Windows binaries / Build win32 binaries (push) Has been cancelled
`README.md`: Drop AppVeyor badge
2025-03-28 01:03:07 +01:00
Sebastian Pipping
6eda25c9c1 Changes: Document #994 2025-03-27 22:28:01 +01:00
Sebastian Pipping
86e382f542 README.md: Drop AppVeyor badge 2025-03-27 22:26:34 +01:00
Sebastian Pipping
f9a3eeb3e0
Merge pull request #993 from libexpat/issue-990-prepare-release
Prepare release 2.7.1 (part of #990, ETA 2025-03-27)
2025-03-27 19:40:10 +01:00
Sebastian Pipping
2b2a24691a Sync file headers 2025-03-27 17:45:25 +01:00
Sebastian Pipping
55ce34c669 Set release date for 2.7.1 2025-03-27 17:45:25 +01:00
Sebastian Pipping
a6497c3004 Bump version to 2.7.1 2025-03-27 17:45:25 +01:00
Sebastian Pipping
d8d5b39933 Bump version info from 11:1:10 to 11:2:10
See https://verbump.de/ for what these numbers do
2025-03-27 17:45:25 +01:00
Sebastian Pipping
bec461e1db Changes: Document changes in release Expat 2.7.1 2025-03-27 17:45:25 +01:00
Sebastian Pipping
6312a385a0
Merge pull request #982 from libexpat/perl-integration-tests-ci
Some checks are pending
Ensure that GNU Autotools and CMake build systems agree / Ensure that GNU Autotools and CMake build systems agree (push) Waiting to run
Enforce clang-format clean code / Enforce clang-format clean code (push) Waiting to run
Enforce Clang Static Analyzer (scan-build) clean code / Enforce Clang Static Analyzer (scan-build) clean code (push) Waiting to run
Enforce clang-tidy clean code / Enforce clang-tidy clean code (push) Waiting to run
Ensure realistic minimum CMake version requirement / Ensure realistic minimum CMake version requirement (push) Waiting to run
Enforce codespell-clean spelling / Enforce codespell-clean spelling (push) Waiting to run
Collect test coverage / Collect test coverage (push) Waiting to run
Upload build to Coverity Scan / Upload build to Coverity Scan (push) Waiting to run
Run Cppcheck (from macOS Homebrew) / Run Cppcheck (push) Waiting to run
Build with Emscripten / Build with Emscripten (push) Waiting to run
Check expat_config.h.{in,cmake} for regressions / Check expat_config.h.{in,cmake} for regressions (push) Waiting to run
Run fuzzing regression tests / Run fuzzing regression tests (push) Waiting to run
Run Linux CI tasks / Perform checks (push) Waiting to run
Run macOS CI tasks / Perform checks (push) Waiting to run
Build with musl / Build with musl (push) Waiting to run
Run Perl XML::Parser integration tests / Run Perl XML::Parser integration tests (push) Waiting to run
Ensure well-formed and valid XML / Ensure well-formed and valid XML (push) Waiting to run
Build Windows binaries / Build win32 binaries (push) Waiting to run
Build Windows binaries / Build win64 binaries (push) Waiting to run
Build on Windows / Build on Windows (windows-2022, x64, wchar_t) (push) Waiting to run
Build on Windows / Build on Windows (windows-2019, Win32, char) (push) Waiting to run
Make GitHub Actions run Perl XML::Parser integration tests
2025-03-27 17:45:03 +01:00
Sebastian Pipping
1aa1b1d32a Changes: Document #982 2025-03-27 16:13:44 +01:00
Sebastian Pipping
b9f9170d69 Make GitHub Actions run Perl XML::Parser integration tests 2025-03-27 16:13:06 +01:00
Sebastian Pipping
c8d69c6e0b
Merge pull request #989 from berkayurun/fix-m_eventPtr
Stop updating event pointer on exit for reentry (fixes #980)
2025-03-27 16:11:47 +01:00
Sebastian Pipping
09cbf95925
Merge pull request #991 from libexpat/clang-tidy-reenable-valist-uninitialized
Some checks are pending
Ensure that GNU Autotools and CMake build systems agree / Ensure that GNU Autotools and CMake build systems agree (push) Waiting to run
Enforce clang-format clean code / Enforce clang-format clean code (push) Waiting to run
Enforce Clang Static Analyzer (scan-build) clean code / Enforce Clang Static Analyzer (scan-build) clean code (push) Waiting to run
Enforce clang-tidy clean code / Enforce clang-tidy clean code (push) Waiting to run
Ensure realistic minimum CMake version requirement / Ensure realistic minimum CMake version requirement (push) Waiting to run
Enforce codespell-clean spelling / Enforce codespell-clean spelling (push) Waiting to run
Collect test coverage / Collect test coverage (push) Waiting to run
Upload build to Coverity Scan / Upload build to Coverity Scan (push) Waiting to run
Run Cppcheck (from macOS Homebrew) / Run Cppcheck (push) Waiting to run
Build with Emscripten / Build with Emscripten (push) Waiting to run
Check expat_config.h.{in,cmake} for regressions / Check expat_config.h.{in,cmake} for regressions (push) Waiting to run
Run fuzzing regression tests / Run fuzzing regression tests (push) Waiting to run
Run Linux CI tasks / Perform checks (push) Waiting to run
Run macOS CI tasks / Perform checks (push) Waiting to run
Build with musl / Build with musl (push) Waiting to run
Ensure well-formed and valid XML / Ensure well-formed and valid XML (push) Waiting to run
Build Windows binaries / Build win32 binaries (push) Waiting to run
Build Windows binaries / Build win64 binaries (push) Waiting to run
Build on Windows / Build on Windows (windows-2019, Win32, char) (push) Waiting to run
Build on Windows / Build on Windows (windows-2022, x64, wchar_t) (push) Waiting to run
Re-enable clang-tidy warning `clang-analyzer-valist.Uninitialized`
2025-03-27 04:32:03 +01:00
Sebastian Pipping
fd02936f25
Merge pull request #992 from libexpat/readme-openssf-best-practices-badge
`README.md`: Add badge for OpenSSF Best Practices
2025-03-27 04:27:03 +01:00
Sebastian Pipping
bedbf381b3 Changes: Document #992 2025-03-27 03:31:44 +01:00
Sebastian Pipping
2dc146751a README.md: Add badge for OpenSSF Best Practices 2025-03-27 03:27:04 +01:00
Sebastian Pipping
9c51ecefcd Changes: Document #991 2025-03-27 03:12:39 +01:00
Sebastian Pipping
89026a3c6b apply-clang-tidy.sh: Re-enable warning clang-analyzer-valist.Uninitialized 2025-03-27 03:12:33 +01:00
Sebastian Pipping
308c31ed64 Changes: Document #980 #989 2025-03-25 18:31:41 +01:00
Sebastian Pipping
c096f96980 tests: Cover m_eventPtr value with entities and reentering
m_eventPtr is a key provider to these functions:
- XML_GetCurrentByteCount
- XML_GetCurrentByteIndex
- XML_GetCurrentColumnNumber
- XML_GetCurrentLineNumber
- XML_GetInputContext
2025-03-25 18:31:41 +01:00
Sebastian Pipping
f3feb0d09c tests: Make strndup(3) available to C99 2025-03-25 18:31:41 +01:00
Berkay Eren Ürün
bcf353990c Make parser->m_eventPtr handling clearer 2025-03-25 18:30:47 +01:00
Berkay Eren Ürün
89a9c6807c Stop updating m_eventPtr on exit for reentry
The fix for recursive entity processing introduced a reenter flag that
returns the execution from the current function and switches to entity
processing.

The same fix also updates the m_eventPtr during this switch. However
this update changes the behaviour in certain cases as the older version
does not update the m_eventPtr while recursing into entity processing.

This commit removes the pointer update and restores the old behaviour.
2025-03-25 18:30:47 +01:00
Sebastian Pipping
91ca72e913
Merge pull request #988 from libexpat/dependabot/github_actions/actions/upload-artifact-4.6.2
Some checks failed
Ensure that GNU Autotools and CMake build systems agree / Ensure that GNU Autotools and CMake build systems agree (push) Has been cancelled
Collect test coverage / Collect test coverage (push) Has been cancelled
Upload build to Coverity Scan / Upload build to Coverity Scan (push) Has been cancelled
Run Cppcheck (from macOS Homebrew) / Run Cppcheck (push) Has been cancelled
Run macOS CI tasks / Perform checks (push) Has been cancelled
Enforce clang-format clean code / Enforce clang-format clean code (push) Has been cancelled
Enforce Clang Static Analyzer (scan-build) clean code / Enforce Clang Static Analyzer (scan-build) clean code (push) Has been cancelled
Enforce clang-tidy clean code / Enforce clang-tidy clean code (push) Has been cancelled
Ensure realistic minimum CMake version requirement / Ensure realistic minimum CMake version requirement (push) Has been cancelled
Enforce codespell-clean spelling / Enforce codespell-clean spelling (push) Has been cancelled
Build with Emscripten / Build with Emscripten (push) Has been cancelled
Check expat_config.h.{in,cmake} for regressions / Check expat_config.h.{in,cmake} for regressions (push) Has been cancelled
Run fuzzing regression tests / Run fuzzing regression tests (push) Has been cancelled
Run Linux CI tasks / Perform checks (push) Has been cancelled
Build with musl / Build with musl (push) Has been cancelled
Ensure well-formed and valid XML / Ensure well-formed and valid XML (push) Has been cancelled
Build Windows binaries / Build win32 binaries (push) Has been cancelled
Build Windows binaries / Build win64 binaries (push) Has been cancelled
Build on Windows / Build on Windows (windows-2019, Win32, char) (push) Has been cancelled
Build on Windows / Build on Windows (windows-2022, x64, wchar_t) (push) Has been cancelled
Actions(deps): Bump actions/upload-artifact from 4.6.1 to 4.6.2
2025-03-24 18:02:52 +01:00
dependabot[bot]
9c7609a007
Actions(deps): Bump actions/upload-artifact from 4.6.1 to 4.6.2
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.6.1 to 4.6.2.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](4cec3d8aa0...ea165f8d65)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-24 12:45:06 +00:00
Sebastian Pipping
453c150541
Merge pull request #987 from libexpat/clang-static-analyzer
Make GitHub Actions apply Clang Static Analyzer
2025-03-22 02:30:01 +01:00
Sebastian Pipping
6a56fd6f9e Changes: Document #987 2025-03-22 01:30:36 +01:00
Sebastian Pipping
ad45b4f4e2 Make GitHub Actions apply Clang Static Analyzer 2025-03-22 01:21:50 +01:00
Sebastian Pipping
ec81c552a1
Merge pull request #986 from libexpat/address-frama-c-warning
Address Frama-C warning
2025-03-21 23:49:12 +01:00
Sebastian Pipping
d53df45fd8 Changes: Document #986 2025-03-21 23:07:17 +01:00
Sebastian Pipping
ea3b852acf lib/xmlparse.c: Address warning from frama-c 30.0
The symptom was:
> [variadic:typing] lib/xmlparse.c:8242: Warning:
>   Incorrect type for argument 7. The argument will be cast from unsigned int to int.
2025-03-21 23:02:05 +01:00
Sebastian Pipping
6fd58ad630
Merge pull request #984 from libexpat/issue-983-emscripten-support
Fix `printf` format specifiers for 32bit Emscripten (fixes #983) + cover compilation with 32bit Emscripten in CI
2025-03-17 04:32:05 +01:00
Sebastian Pipping
5c1385f94e Changes: Document #983 #984 2025-03-17 03:49:10 +01:00
Sebastian Pipping
2f6611391e Make GitHub Actions cover compilation with 32bit Emscripten 2025-03-17 03:49:10 +01:00
Sebastian Pipping
41fcb44549 lib/internal.h: Fix printf format specifiers for 32bit mode Emscripten
When compiling with Emscripten 3.1.6, the symptom was:
> [..]
> /usr/bin/emcc  @CMakeFiles/expat.dir/includes_C.rsp -fno-strict-aliasing -fvisibility=hidden -std=c99 -MD -MT CMakeFiles/expat.dir/lib/xmlparse.c.o -MF CMakeFiles/expat.dir/lib/xmlparse.c.o.d -o CMakeFiles/expat.dir/lib/xmlparse.c.o -c /libexpat/expat/lib/xmlparse.c
> /libexpat/expat/lib/xmlparse.c:8132:11: warning: format specifies type 'int' but the argument has type 'ptrdiff_t' (aka 'long') [-Wformat]
>           bytesMore, (account == XML_ACCOUNT_DIRECT) ? "DIR" : "EXP",
>           ^~~~~~~~~
> 1 warning generated.
> [..]
> /usr/bin/emcc -DXML_TESTING @CMakeFiles/runtests.dir/includes_C.rsp -fno-strict-aliasing -fvisibility=hidden -std=c99 -MD -MT CMakeFiles/runtests.dir/tests/acc_tests.c.o -MF CMakeFiles/runtests.dir/tests/acc_tests.c.o.d -o CMakeFiles/runtests.dir/tests/acc_tests.c.o -c /libexpat/expat/tests/acc_tests.c
> /libexpat/expat/tests/acc_tests.c:279:11: warning: format specifies type 'unsigned int' but the argument has type 'unsigned long' [-Wformat]
>           u + 1, countCases, expectedCountBytesDirect, actualCountBytesDirect);
>           ^~~~~
> /libexpat/expat/tests/acc_tests.c:279:18: warning: format specifies type 'unsigned int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
>           u + 1, countCases, expectedCountBytesDirect, actualCountBytesDirect);
>                  ^~~~~~~~~~
> /libexpat/expat/tests/acc_tests.c:288:11: warning: format specifies type 'unsigned int' but the argument has type 'unsigned long' [-Wformat]
>           u + 1, countCases, expectedCountBytesIndirect,
>           ^~~~~
> /libexpat/expat/tests/acc_tests.c:288:18: warning: format specifies type 'unsigned int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
>           u + 1, countCases, expectedCountBytesIndirect,
>                  ^~~~~~~~~~
> 4 warnings generated.
> [..]
> /usr/bin/emcc -DXML_TESTING @CMakeFiles/runtests.dir/includes_C.rsp -fno-strict-aliasing -fvisibility=hidden -std=c99 -MD -MT CMakeFiles/runtests.dir/lib/xmlparse.c.o -MF CMakeFiles/runtests.dir/lib/xmlparse.c.o.d -o CMakeFiles/runtests.dir/lib/xmlparse.c.o -c /libexpat/expat/lib/xmlparse.c
> /libexpat/expat/lib/xmlparse.c:8132:11: warning: format specifies type 'int' but the argument has type 'ptrdiff_t' (aka 'long') [-Wformat]
>           bytesMore, (account == XML_ACCOUNT_DIRECT) ? "DIR" : "EXP",
>           ^~~~~~~~~
> 1 warning generated.
> [..]
> /usr/bin/em++ -DXML_TESTING @CMakeFiles/runtests_cxx.dir/includes_CXX.rsp -fno-strict-aliasing -fvisibility=hidden -std=c++11 -MD -MT CMakeFiles/runtests_cxx.dir/tests/acc_tests_cxx.cpp.o -MF CMakeFiles/runtests_cxx.dir/tests/acc_tests_cxx.cpp.o.d -o CMakeFiles/runtests_cxx.dir/tests/acc_tests_cxx.cpp.o -c /libexpat/expat/tests/acc_tests_cxx.cpp
> In file included from /libexpat/expat/tests/acc_tests_cxx.cpp:32:
> /libexpat/expat/tests/acc_tests.c:279:11: warning: format specifies type 'unsigned int' but the argument has type 'unsigned long' [-Wformat]
>           u + 1, countCases, expectedCountBytesDirect, actualCountBytesDirect);
>           ^~~~~
> /libexpat/expat/tests/acc_tests.c:279:18: warning: format specifies type 'unsigned int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
>           u + 1, countCases, expectedCountBytesDirect, actualCountBytesDirect);
>                  ^~~~~~~~~~
> /libexpat/expat/tests/acc_tests.c:288:11: warning: format specifies type 'unsigned int' but the argument has type 'unsigned long' [-Wformat]
>           u + 1, countCases, expectedCountBytesIndirect,
>           ^~~~~
> /libexpat/expat/tests/acc_tests.c:288:18: warning: format specifies type 'unsigned int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
>           u + 1, countCases, expectedCountBytesIndirect,
>                  ^~~~~~~~~~
> 4 warnings generated.
> [..]
> /usr/bin/emcc -DXML_TESTING @CMakeFiles/runtests_cxx.dir/includes_C.rsp -fno-strict-aliasing -fvisibility=hidden -std=c99 -MD -MT CMakeFiles/runtests_cxx.dir/lib/xmlparse.c.o -MF CMakeFiles/runtests_cxx.dir/lib/xmlparse.c.o.d -o CMakeFiles/runtests_cxx.dir/lib/xmlparse.c.o -c /libexpat/expat/lib/xmlparse.c
> /libexpat/expat/lib/xmlparse.c:8132:11: warning: format specifies type 'int' but the argument has type 'ptrdiff_t' (aka 'long') [-Wformat]
>           bytesMore, (account == XML_ACCOUNT_DIRECT) ? "DIR" : "EXP",
>           ^~~~~~~~~
> 1 warning generated.
2025-03-17 03:49:10 +01:00
Sebastian Pipping
9f52e11c2c
Merge pull request #981 from libexpat/musl-ci
Make GitHub Actions cover compilation with musl
2025-03-16 02:08:12 +01:00
Sebastian Pipping
26de2e1daa Changes: Document #981 2025-03-16 00:48:01 +01:00
Sebastian Pipping
f0394e734a Make GitHub Actions cover compilation with musl 2025-03-16 00:48:01 +01:00