nand2 / libvmod-throttle

Varnish: Reject or delay requests after given tresholds are reached. (Think API rate limit, or per-ip MISS rate limit)
Other
100 stars 22 forks source link

Should use C99 by default #6

Open xiongchiamiov opened 10 years ago

xiongchiamiov commented 10 years ago

When I first tried compiling vmod_throttle, I got a number of errors like this:

vmod_throttle.c: In function '_vmod_remove_older_entries':
vmod_throttle.c:261: error: 'for' loop initial declaration used outside C99 mode

It compiled successfully when I added CFLAGS=-std=gnu99 to my ./configure command.

I saw mention somewhere on the net that gcc would be moving to 99 as the default (instead of 89), so perhaps this is only a problem because I'm using the ancient gcc 4.1.2.

I didn't try compiling with -std=c99.

mrpatrick commented 9 years ago

+1 - I had the same issue. Thanks @xiongchiamiov for the fix!