You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/07/05 08:07:59 UTC
[GitHub] hrsakai opened a new pull request #2086: Add std=c99 to
CMAKE_C_FLAGS to avoid compile error with gcc-4.8
hrsakai opened a new pull request #2086: Add std=c99 to CMAKE_C_FLAGS to avoid compile error with gcc-4.8
URL: https://github.com/apache/incubator-pulsar/pull/2086
### Motivation
I got following error when I compile example codes with gcc-4.8 on centos7.
```
[ 89%] Building C object examples/CMakeFiles/SampleProducerCApi.dir/SampleProducerCApi.c.o
/root/incubator-pulsar/pulsar-client-cpp/examples/SampleProducerCApi.c: In function ‘main’:
/root/incubator-pulsar/pulsar-client-cpp/examples/SampleProducerCApi.c:39:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (int i = 0; i < 10; i++) {
^
/root/incubator-pulsar/pulsar-client-cpp/examples/SampleProducerCApi.c:39:5: note: use option -std=c99 or -std=gnu99 to compile your code
make[2]: *** [examples/CMakeFiles/SampleProducerCApi.dir/SampleProducerCApi.c.o] Error 1
make[1]: *** [examples/CMakeFiles/SampleProducerCApi.dir/all] Error 2
make: *** [all] Error 2
```
### Modifications
Add -std=c99 to CMAKE_C_FLAGS to avoid compile error with gcc-4.8.
### Result
I can compile example codes with gcc-4.8.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services