2
0
mirror of https://github.com/boostorg/wave.git synced 2026-01-23 06:02:18 +00:00
Commit Graph

1062 Commits

Author SHA1 Message Date
Peter Dimov
f813e52017 Avoid inclusion of deprecated header 2024-09-29 15:20:45 +03:00
jwnhy
ef14767aec Fix empty stringify under C++20 (#221)
* fix segment fault of empty stringify under C++20
* Add tests for optional comma in variadic macro call

---------

Co-authored-by: Jeff Trull <edaskel@att.net>
2024-09-15 14:42:33 +10:00
René Ferdinand Rivera Morell
7ce8b53d9d Add support for modular build structure. (#214)
* Make the library modular usable.

* Switch to library requirements instead of source. As source puts extra source in install targets.

* Add wave tool build to all target.

* Add missing NO_LIB usage requirements.

* Add requires-b2 check to top-level build file.

* Bump B2 require to 5.2

* Change all <source> references to <library>.

* Move inter-lib dependencies to a project variable and into the build targets.

* Update build deps.
2024-08-26 22:01:03 -07:00
Jeff Trull
0e7388b8ae Merge pull request #217 from jefftrull/ci-pin-node16
Use only node16 in CI to work around glibc version mismatch with node20 in old containers
2024-08-26 21:48:52 -07:00
Jeff Trull
8b62268ddd Use only node16 in CI
To test against different compiler versions we use older Docker
images, which in turn have different glibc versions. Github recently
deprecated Node version 16, which had been built with an older glibc
version, and the newer Node version requires a glibc version that is
not available on the old images, causing builds to fail.

This is a hack permitting the continued use of Node 16, until Github
decides to make it impossible.
2024-08-26 20:56:32 -07:00
Jeff Trull
46bd710ada Merge pull request #212 from jefftrull/changelog_1.86
Update ChangeLog for 1.86
2024-06-25 22:03:12 -07:00
Jeff Trull
3819adaea3 Update ChangeLog for 1.86 2024-06-25 22:02:08 -07:00
Jeff Trull
da98931899 Merge pull request #207 from jefftrull/bugfix/ub-signed-overflow
Fix checks for signed overflow
2024-06-25 21:53:44 -07:00
Jeff Trull
8f1052cda3 Merge pull request #211 from jefftrull/bugfix/vsnprintf
Use the safer vsnprintf, instead of vsprintf
2024-06-25 21:52:52 -07:00
Jeff Trull
7265c575a8 Use vsnprintf instead of vsprintf
Issue noted by MSVC (as a warning)
2024-06-25 16:31:13 -07:00
Jeff Trull
df2125a1bd Repair Overflow Checks
The previous code checked for signed overflow on +, -, and * by doing
the operation and checking the result, which can invoke undefined
behavior. This replaces that code with initial tests on the operands.

In addition, a test for the sole integer division overflow case (that
is not division by zero) was missing: INT_MIN / -1
It has now been added, along with a test case.
2024-06-25 15:00:02 -07:00
Jeff Trull
8f22cdccb5 Update ChangeLog for 1.85 (#208) 2024-03-31 19:44:44 -07:00
chisolm
737c1e07ee Update marker before and after fill() operation in cpplexer (#203)
* Update marker before and after fill() operation in cpplexer

* A basic test case for trigraph "pound" (octothorpe) on fill boundary (detects the marker issue)

This change resolves #202 

---------

Co-authored-by: Chris Chisolm <chris_chisolm@intuit.com>
Co-authored-by: Jeff Trull <edaskel@att.net>
2024-01-30 10:16:07 -08:00
Jeff Trull
ff13dee917 Fixes for escaped newline handling (#205)
* Check for backslash characters before the start of the new data

With BOOST_WAVE_BSIZE set to 40, test t_5_002 fails because a newline appears exactly at the beginning of a newly
fetched buffer, and a backslash is at the end of the previous one. In that case the escaped newline
was not detected. This change will also consider three unprocessed bytes of input data, if available,
prior to the new data, which is enough to detect a trigraph backslash.

* Improve data range check for backslash newline

The existing check considered the space required for a trigraph backslash, but not for the following LF (or CRLF) before testing for them. With BOOST_WAVE_BSIZE set to 98 this caused a segfault in t_5_001.
2024-01-29 16:57:04 -08:00
Jeff Trull
f9c302da5b Use correct string constructor for non-null-terminated range (#204)
There is no guarantee (indeed, it is unlikely) that data within the
scanner buffer will be null terminated, and so the constructor that
accepts a pointer and a count is appropriate.
2024-01-28 18:24:18 -08:00
Jeff Trull
543a0e9e1d Restore previous newline output after pragma (#201)
This line was inadvertently removed in 1.84 as part of another bug
fix. This change restores it and improves the associated unit test.
2024-01-17 19:09:53 -08:00
Jeff Trull
ccec592137 Upgrade stale CI config (#199)
* Update runner OS options so all jobs execute

* Add C++20 to matrix

* Add gcc-9 and msvc-14.3 (via Appveyor) to matrix
2024-01-17 11:43:50 -08:00
Jeff Trull
6f4d8f7cbe Merge pull request #198 from jefftrull/bugfix/more-fs-deprecation-removal
Handle some previously deprecated, now removed, filesystem code
2024-01-14 22:15:11 -08:00
Jeff Trull
d8474c3e2d Handle some previously deprecated, now removed, filesystem code
- convenience.hpp is removed
- no_push and branch_path are removed
2024-01-14 15:06:47 -08:00
Jeff Trull
abe718abf4 Merge pull request #193 from jefftrull/boost-1.84-changelog
Update Changelog for 1.84 to reflect one fixed bug
2023-10-25 15:39:28 -07:00
Jeff Trull
7f3b3e4ab4 Update Changelog for 1.84 to reflect one fixed bug 2023-10-25 15:38:12 -07:00
Jeff Trull
70097dacde Merge pull request #192 from jefftrull/bugfix/filesystem-deprecations
Replace deprecated boost::filesystem methods with their new names
2023-10-25 15:33:07 -07:00
Jeff Trull
de0d131cf3 Merge pull request #191 from jefftrull/bugfix/pragma-crash
Support a single #pragma without body
2023-10-25 15:32:48 -07:00
Jeff Trull
8a763396a1 Merge pull request #190 from jefftrull/bugfix/update-cmake
Make updates for CMake version, dependencies, and C++ standard
2023-10-25 15:32:25 -07:00
Jeff Trull
a5d4722e52 Replace deprecated boost::filesystem methods with their replacements
This will be for Boost 1.84 forward. The new replacements were
available previously, so for some versions before 1.84 we'll still see
deprecation warnings if users mix versions of Boost and Wave.
2023-10-24 11:39:08 -07:00
Jeff Trull
28ff870cc5 Support a single #pragma without body
The existing code assumed there was at least one space following
 #pragma, but that is not required.
2023-10-23 20:07:47 -07:00
Jeff Trull
c30b995a77 Make updates for CMake version, dependencies, and C++ standard
These issues were noted by Peter Dimov and the fix was to rerun
boostdep (with a couple of manual changes for src/cpplexer files)
2023-10-23 15:04:35 -07:00
Jeff Trull
61abf8b6b9 Merge pull request #186 from jefftrull/feature/changelog-1.82
update changelog for release
2023-03-29 15:24:21 -07:00
Jeff Trull
ca7047adc8 update changelog for release 2023-03-29 15:22:55 -07:00
Jeff Trull
f4702729eb Merge pull request #185 from AmesingFlank/fix_memmove
Fix UB in memmove
2023-03-28 11:39:45 -07:00
Dunfan Lu
0c4ca96c5b Fix UB in memmove 2023-03-27 13:42:45 -04:00
Jeff Trull
5a78412d3a Merge pull request #179 from jefftrull/changelog-1.81
Update ChangeLog for 1.81
2022-11-09 00:02:34 -08:00
Jeff Trull
eccf0f1be1 Merge pull request #178 from jefftrull/bugfix/add-missing-escaped-charlit-test
Add test for \e \E escape sequences overlooked in prior commit
2022-11-09 00:02:19 -08:00
Jeff Trull
d590edd52e Update ChangeLog for 1.81 2022-11-08 18:20:45 -08:00
Jeff Trull
f10ee1fc3d Add test for \e \E feature overlooked in prior commit 2022-11-08 18:13:32 -08:00
Jeff Trull
110fe9c43c Merge pull request #177 from jefftrull/feature/support-escape-char-literals
Support \e and \E in character and string literals
2022-11-08 18:08:50 -08:00
Jeff Trull
3586cf3706 Support \e and \E in character and string literals
Updates the non-strict lexer to support e and E, both with value 27
(ASCII ESC). Also adds tests for lexing these literals, and checks
that they are usable in conditional preprocessor expressions.
2022-11-07 22:44:24 -08:00
Jeff Trull
4c3ae3508e Merge pull request #176 from DavidCNou/175_exception_handler_buffer_overrun
Fix potential buffer overflow, fixes boostorg/wave#175
2022-11-07 13:04:14 -08:00
DavidCNou
9b05a6b35f Fix potential buffer overflow, fixes boostorg/wave#175 2022-11-07 14:31:35 -05:00
Jeff Trull
44362764b9 Merge pull request #173 from frederick-vs-ja/patch-max_size
Use `boost::allocator_max_size` for `SmallStringOpt` to obtain allocator's max size
2022-09-13 15:08:14 -07:00
Jeff Trull
58fd0bce3f Merge branch 'master' into develop 2022-09-13 13:40:53 -07:00
A. Jiang
d1ae14876f Use boost::allocator_max_size to obtain allocator's max_size
Perhaps missed in previous PRs.
2022-09-05 11:00:16 +08:00
Jeff Trull
c524b58847 Fix line directives after endif following else (#170) (#171)
* Fix line directives after endif when else clause is present

The initial part of a conditional block (the if/ifdef/ifndef) takes
the "slow" path through the code in cpp_iterator.hpp using the C++
expression grammar, while else and endif directives take the "fast"
path. The slow path sets must_emit_line_directive, and it will be
cleared after either else or endif is processed. Unfortunately when
an else precedes the endif, must_emit_line_directive is cleared and is
never set, as only the slow path sets it. The result is proper line
directives are issued for the else clause, but not for the subsequent
endif.

This changes adds setting of must_emit_line_directive in the "fast"
path for endif so line directives are considered after an intervening else.
boost-1.80.0.beta1 boost-1.80.0
2022-06-25 13:05:53 -07:00
Jeff Trull
68b8e26625 Fix line directives after endif following else (#170)
* Fix line directives after endif when else clause is present

The initial part of a conditional block (the if/ifdef/ifndef) takes
the "slow" path through the code in cpp_iterator.hpp using the C++
expression grammar, while else and endif directives take the "fast"
path. The slow path sets must_emit_line_directive, and it will be
cleared after either else or endif is processed. Unfortunately when
an else precedes the endif, must_emit_line_directive is cleared and is
never set, as only the slow path sets it. The result is proper line
directives are issued for the else clause, but not for the subsequent
endif.

This changes adds setting of must_emit_line_directive in the "fast"
path for endif so line directives are considered after an intervening else.
2022-06-25 07:09:56 -07:00
Jeff Trull
8012d578e0 Merge pull request #169 from boostorg/develop
Update for 1.80 release
2022-06-23 04:03:22 -04:00
Jeff Trull
9a396fff2f Update ChangeLog for 1.80 (#168) 2022-06-23 00:25:06 -07:00
Jeff Trull
83cb264b5f Use constexpr instead of macros for tokenid constants in samples (#167)
Under Visual Studio 2019 (and possibly 2017), building with /permissive- causes three samples to fail to compile. Adding the /Zc:twoPhase- option makes them compile successfully again. See bug #160 for more details.

It's unclear what the source of this issue is, but using constexpr variables instead of a macro is better practice anyway, and fixes the errors.
2022-06-22 17:35:44 -07:00
Jeff Trull
44e3f30ff9 Let long integer literals participate in conditional expressions (#165)
Also add a test case for this situation
2022-06-22 11:23:06 -07:00
Jeff Trull
977b67a1d0 Fix missing (uncalled) exception hooks (#166)
* Check hooks after expected errors, not just when there are none

Some unit tests had intentional errors, and code to verify that the
appropriate hooks were called, but we never checked.

* Update unit tests to match hooks, now that we are checking

* Fix bug revealed by checking the hooks

Or in other words, bug #161 (thanks abakhirkin for the fix)

* Fix link in documentation
2022-06-22 11:22:27 -07:00
Andrey Semashev
71fb0d8390 Fix warnings about freeing non-heap-allocated object (#163)
* Use capacity() == 0 as the definitive mark of an empty string storage.

Comparing the pointer with the static emptyString_ member of the
SimpleStringStorage class will likely break if the comparison happens
across shared library boundary. So use capacity() == 0 consistently
to detect whether the storage refers to the emptyString_ member.
When capacity is non-zero the data is always dynamically allocated.

* Suppress gcc 11.2 -Wfree-nonheap-object warnings.

The warnings are bogus because the pData_ pointer never points to
emptyString_ if capacity() == 0, and always points otherwise. The
compiler simply fails to deduce this invariant.

Unfortunately, suppressing the warning with a #pragma doesn't work,
so we have to invent a compile-time assert that will make the invariant
detectable by the compiler.

Closes https://github.com/boostorg/wave/issues/159.

* Removed unused AllocatorStringStorage::Realloc function.

This function was not used and potentially incorrect, as it unconditionally
calls Free, which would be wrong if the original buffer was emptyString_.
2022-06-16 16:02:59 -07:00