grammars-v4 icon indicating copy to clipboard operation
grammars-v4 copied to clipboard

[build] Numerous warnings in Annotations section of a build

Open kaby76 opened this issue 1 year ago • 1 comments

There are numerous warnings for the Go and Cpp targets. See https://github.com/antlr/grammars-v4/actions/runs/7183158267

Restore cache failed: Dependencies file is not found in /home/runner/work/grammars-v4/grammars-v4. Supported file pattern: go.sum

...

'antlr4::dfa::Vocabulary::EMPTY_VOCABULARY': Use the default constructor of Vocabulary instead.

...

'initializing': conversion from '_Ty' to '_Ty1', possible loss of data

etc.

kaby76 avatar Dec 12 '23 15:12 kaby76

  • Cpp runtime contains an error. At least for Ubuntu GNU g++ 9.4.0 and Windows VS2022 C++, this line is unnecessary because static fields are defining occurrences. Commenting out this line results in a program to link perfectly. In addition, adding this code to a driver auto foo = new antlr4::dfa::Vocabulary(); foo->EMPTY_VOCABULARY;, which is an applied occurrence of the identifier EMPTY_VOCABULARY, causes the warning to be outputted by the compiler. And again, the program links and works perfectly fine. The compiler on MacOSX does not give the warning. In other words, the code was developed on Mac and was not cleared of errors on the other platforms.

kaby76 avatar Dec 12 '23 19:12 kaby76