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

CMakeLists: fix build with old compilers #181

Merged
merged 1 commit into from
Nov 25, 2019
Merged

Conversation

texierp
Copy link
Contributor

@texierp texierp commented Nov 23, 2019

The librsync code uses some C99 constructs, but old compilers such
as gcc 4.7 don't default to -std=c99. This commit makes sure librsync
is built with -std=gnu99.

Fixes:

src/rabinkarp.h:82:5: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (size_t i = len; i; i--) {
^
src/rabinkarp.h:82:5: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code

Signed-off-by: Pierre-Jean Texier pjtexier@koncepto.io

CMakeLists.txt Outdated Show resolved Hide resolved
The librsync code uses some C99 constructs, but old compilers such
as gcc 4.7 don't default to -std=c99. This commit makes sure librsync
is built with -std=c99.

Fixes:

src/rabinkarp.h:82:5: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
     for (size_t i = len; i; i--) {
     ^
src/rabinkarp.h:82:5: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code

Signed-off-by: Pierre-Jean Texier <pjtexier@koncepto.io>
@dbaarda dbaarda merged commit 001c5a3 into librsync:master Nov 25, 2019
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