-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
mpack: compilation error on CentOS 6/7 #1441
Comments
Is it because variable declaration inside the loop?
…On Tue, Jul 16, 2019, 22:58 Takahiro YAMASHITA ***@***.***> wrote:
Bug Report
*Describe the bug*
Compilation error on CentOS 7.
C99 style of mpack causes. gcc of Cent OS 7 can't compile by default.
e.g.
bool mpack_str_check_no_null(const char* str, size_t bytes) {
for (size_t i = 0; i < bytes; ++i)
*To Reproduce*
- Rubular link if applicable:
None
- Example log message if applicable:
None
- Steps to reproduce the problem:
$ cmake3 .. && make
*Expected behavior*
Buildable.
*Screenshots*
None
*Your Environment*
- Version used: git master
- Configuration: none
- Environment name and version (e.g. Kubernetes? What version?):
- Server type and version:
- Operating System and version: CentOS 6/7
- Filters and plugins: None
*Additional context*
Workaround is to use -std=gnu99 or c99.
gcc 5 supports gnu11 by default.
https://www.gnu.org/software/gcc/gcc-5/changes.html
Do we need to check compiler and its version?
diff --git a/lib/mpack-amalgamation-1.0/CMakeLists.txt b/lib/mpack-amalgamation-1.0/CMakeLists.txt
index bbf2ecd..b0fd081 100644--- a/lib/mpack-amalgamation-1.0/CMakeLists.txt+++ b/lib/mpack-amalgamation-1.0/CMakeLists.txt@@ -1,6 +1,6 @@
set(src
src/mpack/mpack.c
)-+add_definitions(-std=gnu99)
add_definitions(-DMPACK_EXTENSIONS=1)
add_library(mpack-static STATIC ${src})
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1441?email_source=notifications&email_token=AAC2INSPQ5UARMNB6CL4DYTP7XHXZA5CNFSM4IEBIJTKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G7PLMJA>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAC2INS4PNL3MSJEHQUVIYLP7XHXZANCNFSM4IEBIJTA>
.
|
Yes. Note: libjemalloc also uses C99 style declaration. We can build it on CentOS. fluent-bit/lib/jemalloc-5.1.0/src/jemalloc.c Line 744 in 15f6a9e
|
@nokute78 what's the specific compiler version ? I would like to pass the info to mpack author |
Maybe gcc 4.8.x. Default version of CentOS7. By the way , similar issue and PR are already reported on mpack repo. |
I've posted the issue in mpack repo: |
@edsiper Thank you. |
@edsiper Thank you. |
Bug Report
Describe the bug
Compilation error on CentOS 7.
C99 style of mpack causes. gcc of Cent OS 7 can't compile by default.
e.g.
To Reproduce
None
None
Expected behavior
Buildable.
Screenshots
None
Your Environment
Additional context
Workaround is to use -std=gnu99 or c99.
gcc 5 supports gnu11 by default.
https://www.gnu.org/software/gcc/gcc-5/changes.html
Do we need to check compiler and its version?
The text was updated successfully, but these errors were encountered: