processone / rtb

Benchmarking tool to stress real-time protocols
https://www.process-one.net/
Apache License 2.0
50 stars 7 forks source link

allow compile on CentOS7 #2

Closed ChaosKid42 closed 6 years ago

ChaosKid42 commented 6 years ago

Compiler on CentOS7 does not like variable declaration in for loops.

zinid commented 6 years ago

Wow, what's wrong with long int on CentOS? That's a part of C99 standard.

zinid commented 6 years ago

Whatever, I merge.

ChaosKid42 commented 6 years ago

Well. long was not the issue. Using a declaration in the for loop was. Still no success in compiling on CentOS7:


==> rtb (compile)
Compiling c_src/rtb_db.c
c_src/rtb_db.c: In function 'generate_users_csv':
c_src/rtb_db.c:104:3: error: 'for' loop initial declarations are only allowed in C99 mode
   for (int i=1; i<=state->capacity; i++) {
   ^
c_src/rtb_db.c:104:3: note: use option -std=c99 or -std=gnu99 to compile your code
ERROR: compile failed while processing /home/rtb/rtb: rebar_abort
make: *** [src] Error 1
``'
zinid commented 6 years ago

Yeah, I commited the proper fix, thanks.

ChaosKid42 commented 6 years ago

Even works on CentOS7 now! :-)

ANSI C89 is quite young IMHO. Only about 29 years. Can barely be considered stable ... :-)

Btw: Thanks!