Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix three warnings (Wunused-parameter, Wsign-compare, Wdeprecated-declarations) and a typo. #4488

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion runtime/Cpp/cmake/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ ANTLR4_TAG - branch/tag used for building antlr4 library

`ANTLR4_TAG` is set to master branch by default to keep the antlr4 library up to date. However, this will require a rebuild after every `clean` is called. Set `ANTLR4_TAG` to a desired commit hash value to avoid rebuilding after every `clean` and keep the build stable, at the cost of not automatically updating to latest commit.

By defualt the ANTLR C++ runtime source is cloned from GitHub. However, users may specify `ANTLR4_ZIP_REPOSITORY` in order to download source as a zip file from [ANTLR downloads](http://www.antlr.org/download.html) (under *C++ Target*) or other locations. For example, this variable could list a zip file included in your the project directory. This is useful for maintaining a canonical source tree for each new build.
By default the ANTLR C++ runtime source is cloned from GitHub. However, users may specify `ANTLR4_ZIP_REPOSITORY` in order to download source as a zip file from [ANTLR downloads](http://www.antlr.org/download.html) (under *C++ Target*) or other locations. For example, this variable could list a zip file included in your the project directory. This is useful for maintaining a canonical source tree for each new build.

Visual C++ compiler users may want to additionally define `ANTLR4_WITH_STATIC_CRT` before including the file. Set `ANTLR4_WITH_STATIC_CRT` to true if ANTLR4 C++ runtime library should be compiled with `/MT` flag, otherwise will be compiled with `/MD` flag. This variable has a default value of `OFF`. Changing `ANTLR4_WITH_STATIC_CRT` after building the library may require reinitialization of CMake or `clean` for the library to get rebuilt.

Expand Down
2 changes: 1 addition & 1 deletion runtime/Cpp/runtime/src/UnbufferedCharStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ size_t UnbufferedCharStream::LA(ssize_t i) {
return EOF;
}

if (_data[static_cast<size_t>(index)] == std::char_traits<wchar_t>::eof()) {
if (_data[static_cast<size_t>(index)] == std::char_traits<char32_t>::eof()) {
return EOF;
}

Expand Down
2 changes: 1 addition & 1 deletion runtime/Cpp/runtime/src/Vocabulary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

using namespace antlr4::dfa;

const Vocabulary Vocabulary::EMPTY_VOCABULARY;
const Vocabulary Vocabulary{};

Vocabulary::Vocabulary(std::vector<std::string> literalNames, std::vector<std::string> symbolicNames)
: Vocabulary(std::move(literalNames), std::move(symbolicNames), {}) {
Expand Down
2 changes: 1 addition & 1 deletion runtime/Cpp/runtime/src/tree/xpath/XPathLexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ void XPathLexer::action(RuleContext *context, size_t ruleIndex, size_t actionInd
}
}

void XPathLexer::IDAction(antlr4::RuleContext *context, size_t actionIndex) {
void XPathLexer::IDAction(antlr4::RuleContext */*context*/, size_t actionIndex) {
Copy link

@jmairboeck jmairboeck Jul 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is generated. I added a comment to #4171 (which is about a similar issue) to fix the generator template instead.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, many thanks!

switch (actionIndex) {
case 0:
if (isupper(getText()[0]))
Expand Down
Loading