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

tweetnacl.c: broken compilation -pedantic and C++ comments (gcc-4.92) #3036

Closed
msune opened this issue Apr 2, 2018 · 3 comments
Closed

tweetnacl.c: broken compilation -pedantic and C++ comments (gcc-4.92) #3036

msune opened this issue Apr 2, 2018 · 3 comments

Comments

@msune
Copy link
Contributor

msune commented Apr 2, 2018

Issue description

Compilation with gcc/g++-4.9 configured as follows:

marc@Beluga:~/personal/msune/libzmq2/build$ ../configure --disable-drafts --enable-debug --disable-silent-rules

Is broken due to tweetnacl.c having C++-like comments:

marc@Beluga:~/personal/msune/libzmq2/build$ make
Making all in doc
make[1]: Entering directory '/home/marc/personal/msune/libzmq2/build/doc'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/marc/personal/msune/libzmq2/build/doc'
make[1]: Entering directory '/home/marc/personal/msune/libzmq2/build'
/bin/bash ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I./src        -pedantic -Werror -Wall -D_GNU_SOURCE -D_REENTRANT -D_THREAD_SAFE -Wno-long-long -g -O0    -g -O0  -MT src/src_libzmq_la-tweetnacl.lo -MD -MP -MF src/.deps/src_libzmq_la-tweetnacl.Tpo -c -o src/src_libzmq_la-tweetnacl.lo `test -f 'src/tweetnacl.c' || echo '../'`src/tweetnacl.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I./src -pedantic -Werror -Wall -D_GNU_SOURCE -D_REENTRANT -D_THREAD_SAFE -Wno-long-long -g -O0 -g -O0 -MT src/src_libzmq_la-tweetnacl.lo -MD -MP -MF src/.deps/src_libzmq_la-tweetnacl.Tpo -c ../src/tweetnacl.c  -fPIC -DPIC -o src/.libs/src_libzmq_la-tweetnacl.o
../src/tweetnacl.c:49:1: error: C++ style comments are not allowed in ISO C90 [-Werror]
 // clang-format off
 ^
../src/tweetnacl.c:49:1: error: (this will be reported only once per input file) [-Werror]
In file included from ../src/tweetnacl.c:51:0:
../src/tweetnacl.h:55:1: error: C++ style comments are not allowed in ISO C90 [-Werror]
 //  Do not call manually! Use random_close from random.hpp
 ^
../src/tweetnacl.h:55:1: error: (this will be reported only once per input file) [-Werror]
cc1: all warnings being treated as errors
Makefile:3655: recipe for target 'src/src_libzmq_la-tweetnacl.lo' failed
make[1]: *** [src/src_libzmq_la-tweetnacl.lo] Error 1
make[1]: Leaving directory '/home/marc/personal/msune/libzmq2/build'
Makefile:4882: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
marc@Beluga:~/personal/msune/libzmq2/build$ ../configure --disable-drafts --enable-debug --disable-silent-rules 

Environment

  • libzmq version 2aa54d662048f420ac0dbd5d9b46559963a675f2
  • OS: Debian8

Minimal test code / Steps to reproduce the issue

  1. Compile with:

marc@Beluga:~/personal/msune/libzmq2/build$ ../configure --disable-drafts --enable-debug --disable-silent-rules

@msune
Copy link
Contributor Author

msune commented Apr 2, 2018

Suggested to disable (all) warnings on that (external?) file via pragma

@bluca
Copy link
Member

bluca commented Apr 2, 2018

I'll fix that, but since you are on Debian libzmq is already there - if you want newer versions you can add the repository:

https://software.opensuse.org/download.html?project=network%3Amessaging%3Azeromq%3Agit-stable&package=libzmq3-dev

@msune
Copy link
Contributor Author

msune commented Apr 2, 2018

Just wanted to rise this.

I was just wanting to compile sources with no-drafts and enable-debug for #2742. I will fix comments for the moment.

bluca added a commit to bluca/libzmq that referenced this issue Apr 2, 2018
msune added a commit to msune/libzmq that referenced this issue Apr 3, 2018
Solution: change missing comments in header file
Fixes: zeromq#3036 and adds on top of '15905c5'
MohammadAlTurany pushed a commit to FairRootGroup/libzmq that referenced this issue Jan 28, 2019
MohammadAlTurany pushed a commit to FairRootGroup/libzmq that referenced this issue Jan 28, 2019
Solution: change missing comments in header file
Fixes: zeromq#3036 and adds on top of '15905c5'
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

No branches or pull requests

2 participants