luohaha / CSpider

A scalable and convenient crawler framework in C:).
https://github.com/luohaha/CSpider
MIT License
367 stars 98 forks source link

Is there a problem with C99/C11? #30

Open AntonioCS opened 8 years ago

AntonioCS commented 8 years ago

What is the issue with the int in the for loop declaration? Gcc and Clang both support C99 and C11.

mzer0-yu commented 8 years ago

variable declared within for-loop is visible in the first following line since C11(C++ 11). e.g. for(int i=0; ;) { } i++;

BUT we are writing C.

AntonioCS commented 8 years ago

C11 is C. The ability do declare and use variables in the for loop declaration simplifies code.

ghost commented 8 years ago

With gcc, -std=c99 must be declared. Which was not specified in Makefile.

mzer0-yu commented 8 years ago

OK. Changes will be added to dev branch.

ghost commented 8 years ago

Great.

AntonioCS commented 8 years ago

:+1: