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 compile error on GCC-12/Ubuntu 22.04 #1

Merged
merged 1 commit into from
Apr 14, 2022
Merged

Conversation

0xxon
Copy link
Member

@0xxon 0xxon commented Apr 14, 2022

Error

[116/1252] Building CXX object auxil/gen-zam/CMakeFiles/gen-zam.dir/src/Gen-ZAM.cc.o
FAILED: auxil/gen-zam/CMakeFiles/gen-zam.dir/src/Gen-ZAM.cc.o
/usr/bin/ccache /usr/bin/g++-12 -DDOCTEST_CONFIG_SUPER_FAST_ASSERTS  -Wall -Wno-unused -g -DDEBUG -DBRO_DEBUG -Wno-register -Werror=vla -g -MD -MT auxil/gen-zam/CMakeFiles/gen-zam.dir/src/Gen-ZAM.cc.o -MF auxil/gen-zam/CMakeFiles/gen-zam.dir/src/Gen-ZAM.cc.o.d -o auxil/gen-zam/CMakeFiles/gen-zam.dir/src/Gen-ZAM.cc.o -c /home/johanna/zeek/auxil/gen-zam/src/Gen-ZAM.cc
/home/johanna/zeek/auxil/gen-zam/src/Gen-ZAM.cc: In member function ‘void TemplateInput::Gripe(const char*, const std::string&) const’:
/home/johanna/zeek/auxil/gen-zam/src/Gen-ZAM.cc:1896:17: error: ‘strlen’ was not declared in this scope
 1896 |         int n = strlen(input_s);
      |                 ^~~~~~
/home/johanna/zeek/auxil/gen-zam/src/Gen-ZAM.cc:7:1: note: ‘strlen’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’?
    6 | #include <regex>
  +++ |+#include <cstring>
    7 |
/home/johanna/zeek/auxil/gen-zam/src/Gen-ZAM.cc: In constructor ‘ZAMGen::ZAMGen(int, char**)’:
/home/johanna/zeek/auxil/gen-zam/src/Gen-ZAM.cc:1922:18: error: ‘strcmp’ was not declared in this scope
 1922 |         auto f = strcmp(file_name, "-") ? fopen(file_name, "r") : stdin;
      |                  ^~~~~~
/home/johanna/zeek/auxil/gen-zam/src/Gen-ZAM.cc:1922:18: note: ‘strcmp’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’?

@ckreibich ckreibich merged commit f8c8fb3 into master Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants