2
0
mirror of https://github.com/boostorg/wave.git synced 2026-01-19 04:42:16 +00:00

1083 Commits

Author SHA1 Message Date
Dunfan Lu
0c4ca96c5b Fix UB in memmove 2023-03-27 13:42:45 -04:00
Jeff Trull
1444cdf539 Merge pull request #180 from boostorg/develop
Boost 1.81 Release
boost-1.82.0.beta1 boost-1.81.0.beta1 boost-1.81.0
2022-11-09 14:30:18 -08: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
Jeff Trull
fabe7e3ab0 Fix up C++03 deprecation (#158)
- Add C++11 feature requirements to test and samples subprojects
- Add constexpr to the features tested for in the deprecation check
- Add the C++11 requirement to the documentation metadata
- Add one C++03 build to the Appveyor list. It should pass without running (serves as a test on the above).

Co-authored-by: Alexander Grund <Flamefire@users.noreply.github.com>
boost-1.79.0 boost-1.79.0.beta1
2022-03-09 19:49:55 -08:00
Jeff Trull
572f4f644a Clean up C++11 requirements further (#157)
- Test the requirement of "constexpr" for the deprecation error
- Ensure C++11 requirements are checked for the samples build
2022-03-09 14:49:54 -08:00
Alexander Grund
0a551b3d15 Add the C++11 requirements also to the test project (#156)
* Add the C++11 requirements also to the test project

* Add missing import
2022-03-09 10:08:50 -08:00
Jeff Trull
473203888f Merge pull request #155 from Flamefire/patch-2
Add "cxxstd" json field to the meta json file.
2022-03-09 08:40:13 -08:00
Jeff Trull
9528042eca Merge pull request #154 from Flamefire/patch-1
Add C++11 constexpr requirement
2022-03-09 08:34:53 -08:00
Alexander Grund
201929dc0c Add "cxxstd" json field to the meta json file. 2022-03-09 17:00:40 +01:00
Alexander Grund
7b87a15af1 Add VS 2013 to Appveyor builds
This is not actually supported but should also not error.
See #153
2022-03-09 16:19:46 +01:00
Alexander Grund
b2f002fa25 Add C++11 constexpr requirement
Fixes #153
2022-03-09 16:16:54 +01:00
Jeff Trull
f861b1a305 Merge pull request #152 from boostorg/develop
Release for Boost 1.79
2022-02-21 13:15:03 -08:00
Jeff Trull
d5b083cd97 Update ChangeLog for 1.79 bugfixes 2022-02-21 11:42:27 -08:00
Jeff Trull
9382ac9e8b MSVC-related cleanups (#150)
* Replace several sprintf's with boost::format or std::to_string
* Clean up MSVC builds by removing pre-C++11 toolsets
* Update build badges
2022-02-20 17:54:26 -08:00
Jeff Trull
9a043482a9 Use portable filesystem string conversion instead of native() (#149)
* use string(), not native(), for Filesystem string conversion
2022-02-09 11:53:31 -08:00
Jeff Trull
1db25211a4 Fix various warnings (#148)
* The comma operator is deprecated inside of square brackets
solution: add parentheses

* Bitwise operations are deprecated between different enum types
solution: add user-defined operators for the combinations we use

* std::tmpnam usage gets a linker warning identifying security issues, recommends mkstemp()
solution: use Boost.Filesystem temporary filename functions
2022-02-05 15:44:11 -08:00
Jeff Trull
a95fa213ef Clean up sprintf usage (#146)
* Replace some sprintfs using boost::format and std::to_string to fix warnings and possibly #145
2022-01-28 15:04:20 -08:00
Jeff Trull
59610d6f79 Extend __has_include() grammar for arbitrary conditional expressions (#144)
* Extend __has_include grammar for complex conditional expressions

The logic handling __has_include erroneously assumed it would always
be the last expression on a line. This code fixes that by extending
the grammar to only consume the __has_include() itself, and count
parentheses as necessary to find the correct input range.

Also add some unit tests to cover the error in the future.

* While I'm at it, a couple of small cleanups

1) Remove unneeded header
2) The wrong BOOST_SPIRIT_DEBUG_TRACE_RULE was commented out
2022-01-18 10:46:16 -08:00
Jeff Trull
b8cbd86ab9 Clarify the purpose of the single_line language option (#142)
It currently says Wave "will now" report an error for input which is not terminated by a newline. In fact it "will not" do that.

I made some additional descriptive edits that made sense to me personally.
2022-01-02 15:06:29 -08:00
Jeff Trull
467afcc46e Qualify "newline at EOF not required" with actually being there (#141)
In C++11 and later modes Wave by default does not require newline prior to EOF. This works
fine but there is one place where the test for this feature was used but Wave is not necessarily
looking at the end of the file: pp_is_last_on_line. One observable (and surprising)
result is that unknown directives are not getting flagged - there may be others. The unit tests
did not discover this problem because they generally do not set c++11 mode.

The necessary qualification is added, along with unit test to cover this issue.
2022-01-02 14:24:39 -08:00
Jeff Trull
f2957045b5 Fix line directives for ifdef and ifndef when default hooks are used (#140)
At some point in the past the handling for #if and #ifdef diverged. The code that handles emitting a line directive when a conditional section is skipped worked for #if but not ifdef/ifndef.

This problem was not observable when the eat_whitespace hooks were used instead of the default_preprocessing hooks, because the former
signals skipped newlines through the may_skip_whitespace hook, hiding the problem. Furthermore, the majority of Wave tests use the eat_whitespace hooks, so it wasn't visible there.

This change restores ifdef/ifndef to the same section as #if, so any changes to conditional handling will happen uniformly. Also, a test case is added to cover the default hooks and this particular case.
2022-01-02 07:09:32 -08:00
Jeff Trull
07f853eda7 Merge pull request #136 from jefftrull/bugfix/require-cxx11-in-jamfile
Specify C++11 requirement in top-level Jamfile
2021-12-09 14:34:52 -08:00
Jeff Trull
40e19ac798 Specify C++11 requirement in top-level Jamfile
Removing C++03 from Wave's CI config isn't enough - the top-level Boost
build will try to build Wave under unsupported standards/compiler versions
without an explicit requirement.

Remove some ugly excess whitespace from the ChangeLog while I'm here.
2021-12-09 10:39:32 -08:00
Jeff Trull
3dbc44ce0a Merge pull request #134 from jefftrull/remove-cxx03-support
Remove support for C++03 and prior compilers
2021-12-08 10:49:47 -08:00
Jeff Trull
8bc982ba17 Update C++03 removal to 1.79, as window has passed 2021-11-03 22:02:26 -07:00
Jeff Trull
87459418b8 Remove support for C++03 and prior compilers
This removes only support for C++98/03 as a compiler for this library.
Wave continues to support C++98 and C++03 constructs as a preprocessor.
2021-11-03 16:05:59 -07:00
Jeff Trull
2e7b679905 Merge pull request #133 from sdarwin/feature/gha_fix_1
Update GitHub Actions CI file
2021-11-03 15:47:31 -07:00
sdarwin
28d43336d1 Update GitHub Actions CI file 2021-07-30 16:10:58 +00:00
Peter Dimov
1d705de40f Add additional source files boost-1.78.0.beta1 boost-1.78.0 boost-1.77.0.beta1 boost-1.77.0 2021-05-28 02:38:26 +03:00
Peter Dimov
3a8b7bd3fc Add CMakeLists.txt 2021-05-28 02:34:58 +03:00
Peter Dimov
77d9fa08b8 Merge branch 'master' into develop 2021-05-28 02:06:30 +03:00
Jeff Trull
4ce0586e3e Merge pull request #129 from sdarwin/githubactions
GitHub Actions config
2021-05-06 08:13:23 -07:00